I am using EF 4.3 and MVC 3.
In an Edit action, I receive an instance of my model with its references associations updated. When I try to update de model I do the following:
public void Update(Client updatedClient)
{
var currentClient = _context.Clientes.Include("Address").Include("Phone").FirstOrDefault(c => c.ClientId == updatedClient.ClientId);
_context.Entry(currentClient).CurrentValues.SetValues(updatedClient);
}
All the properties of the Client class are updated except for the properties of Address and Phone.
Do I have to do it manually or is there an easier way?