Amenti
Amenti

Reputation: 1570

How to update .Net domain service from entity model?

I have not found a way to update a .Net domain service after I changed the underlying entity model.

So when there are changes to the model I create a new domain service as workaround and copy my properties/methods from my old domain service to it.

Is there any easier and maybe less error prone way?

Upvotes: 1

Views: 328

Answers (2)

Ronnie Overby
Ronnie Overby

Reputation: 46480

I've created a snippet that really helps out with this problem. Check my answer here:

Adding additional entities to a Entity Framework backed Domain Service

Upvotes: 0

Amenti
Amenti

Reputation: 1570

Well, the best thing I found are partial classes. In addition to the automatically created DomainService.cs I add a DomainServiceProtected.cs where my implementations I don't want to have overwritten every time something changes in the entity model reside.

Upvotes: 2

Related Questions