I got strange problem when I try to update existing entity.
public void Update(VisitDTO item)
{
using (var ctx = new ReceptionDbContext())
{
var entityToUpdate = ctx.Visits.Attach(new Visit { Id = item.Id });
var updatedEntity = Mapper.Map<Visit>(item);
ctx.Entry(entityToUpdate).CurrentValues.SetValues(updatedEntity);
ctx.SaveChanges();
}
This is my update method. In enity Visit I got some bools values, but i cannot set these to false , when it comes to update from false to true its okay but when I need to change from true to false entity does not update these bools values, other properties updating correctly.