var user = _context.Users.Single(u => u.Id == userId);
user.AssignedInfo = _mapper.Map<AssignedInfo>(assignedInfoDTO);
_context.SaveChanges();
In this case with EF, after the query with the method Single
, all other properties but AssignedInfo
on the user entity will be overwritten? or are skipped and only the AssignedInfo
property is updated?
I ask this because there's a big chance some other users may update those other columns of the table from other endpoints in the api, so I don't want to overwrite other properties than AssignedInfo
on this particular endpoint.
Does it work that way or it does update the entire row with all the fields obtained in the query? I just need to update that particular property, and that's the only point where that property is being updated.