public void Update(Movie entity) { var oldEntity = context.Movies.Find(entity.MovieID); if (entity.MoviePoster == null) { entity.MoviePoster = oldEntity.MoviePoster; } context.Entry(oldEntity).CurrentValues.SetValues(entity); }
public void Update(UserComment entity) { var oldEntity = context.Comments.Find(entity.CommentId); context.Entry(oldEntity).CurrentValues.SetValues(entity); }