ADO.NET Entity Framework: the best way to create a generic interface for business objects?

I am just getting started with ADO.NET Entity Data Model and I was curious what was the best way to extend the behavior of my objects.

Let's say I have a table called Customers and I create an entity model based on this table. I now have an entity class called Clients. I want to add some methods to this class and also implement the interface.

Do I have to directly modify the code in the Designer.cs file, or do I need to inherit from Clients and do my extra work?

Any suggestions / advice would be great.

Thank.

+2


source to share


1 answer


Don't change the designer code. Entities create partial classes, so you can do something like this



public partial class Customer: IAmACoolInterface
{
 //implement stuff here



 }

      

+2


source







All Articles