1
votes

What's the best way to add an additional property called "UpdateType" to my "User" Entity via a Linq to SQL DBML file? There is NO associated database field in the "User" database table. This is just a property that I want to be included in with my "User" class.
alt text

I have the Serializable Mode = Unidirectional so the DBML designer automatically orders all of the DataMember properties so I can't just extend the partial class and add a new property like I normally would do if it wasn't serialized for WCF. alt text

If I add another property I want the UpdateType to be included in the Order so that i can insure that the order doesn't change and break my service's Contract.

1

1 Answers

0
votes

This is a bit out of the box, but maybe you could map your Entities to a DTO, and use the DTOs with WCF instead. In that way, you can change your model as you wish (eg. add a partial class) , and use the model<->DTO mapping to adjust for any differences.

AutoMapper might be useful in that scenario.