Wednesday, 15 February 2012

c# - Entity Framework : Identify single object (Table) affected while updating -



c# - Entity Framework : Identify single object (Table) affected while updating -

there method update user detail.

that method tries update, user detail, person detail, address detail, company detail.

here need perform 1 action if person detail has modified , updated****( or added) [whether other details updated or not]. how ?

user object has next object. user.person user.person.address user.company user.company.address

updateuser method loads person, address, company details user object , updates detail.

now updateuser method using only

if (aocontext.entry(userobject).state == entitystate.added || aocontext.entry(userobject).state == entitystate.detached) aocontext.users.add(userobject); aocontext.savechanges()

c# entity-framework linq-to-entities

No comments:

Post a Comment