How to move from untyped DataSets to POCO\LINQ2SQL in legacy application

Posted by artvolk on Stack Overflow See other posts from Stack Overflow or by artvolk
Published on 2011-01-11T11:13:16Z Indexed on 2011/01/11 11:53 UTC
Read the original article Hit count: 297

Good day!

I've a legacy application where data access layer consists of classes where queries are done using SqlConnection/SqlCommand and results are passed to upper layers wrapped in untyped DataSets/DataTable.

Now I'm working on integrating this application into newer one where written in ASP.NET MVC 2 where LINQ2SQL is used for data access. I don't want to rewrite fancy logic of generating complex queries that are passed to SqlConnection/SqlCommand in LINQ2SQL (and don't have permission to do this), but I'd like to have result of these queries as strong-typed objects collection instead of untyped DataSets/DataTable.

The basic idea is to wrap old data access code in a nice-looking from ASP.NET MVC "Model".

What is the fast\easy way of doing this?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about linq-to-sql