How do I make my Linq to Sql entity implement INot

2020-04-17 02:52发布

问题:

I've manually created some classes in the Linq-to-sql designer and when looking in the xx.designer.cs file the class doesn't implement INotifyPropertyChanged interface.

This works if I create the entity by dragging from the server explorer.

Does anyone know why this is and if I am doing something wrong or if there is somewhere to set this up in the designer.

Cheers.

回答1:

It looks like it doesn't do this unless you mark a member as a primary key. Then it does this. Presumably change tracking is useless without a primary key...