Reputation: 12998
I have an ASP.NET application with existing business classes and a database schema. (which I would like to keep) Currently I am using ADO.NET for the DAL, but I would like to switch to some advanced technology there for easier data retrieval.
I looked into Entity Framework, but I am still pretty much getting confused about it.
Is EF applicable to my situation? Can I use it without splitting up my business classes and auto code generation? Can LINQ to SQL solve my problem better?
All I want to do is map my existing classes to the existing tables and dont have to handle details of the data retrieval myself.
Upvotes: 1
Views: 682
Reputation: 3919
I've done what you're proposing (converted an existing ADO.NET application to LINQ to SQL) with relative ease. I found LINQ to SQL to have everything I needed, so I opted for it over EF for simplicity.
LINQ to SQL's generated classes are partial
(the same is true for EF) so you can make your existing classes partial, remove the database column properties (since they'll now be in the generated partial file) and that's about it.
You'll need to decide what pattern your DAL uses, whether a repository pattern, a custom one, or maybe your existing system has one you want to stick with.
Anyway, I've had success converting a legacy/homegrown/ADO.NET system to LINQ to SQL and would recommend it.
Upvotes: 2