![]() If we double click this file on our solution explorer view a designer screen will be opened and we can drag-and-drop the tables that we want to be mapped. We need to add new “LINQ to SQL Classes” that will create new. Next thing that we need to do is to add new. How to create L2S table mapped classesįor this demonstration I’ve created sample database with two very simple tables Employees and Animals and create mapped classes for them and show you also very simple usage. Here I’ll show you how can you add a base class to the L2S entities that can be used for auditing, creating domain events or whatever behavior that you want to achieve across all entities. Inheritance is much easier to implement in EF but it can also be done in L2S although in a not very clean way, at least not that I know of. If you like to go more into details on this read this topic: L2S vs Ef. ![]() Of course, for more robust system I would go with EF because of the better control and the relations between the context objects. I always tend to use LINQ to SQL (L2S) in smaller projects rather than Entity Framework (EF), it’s more lightweight and provides faster development for projects of this scope.
0 Comments
Leave a Reply. |