public void Update(UserFavoriteResult result) { context.Entry(result).State = result.Id == 0 ? System.Data.Entity.EntityState.Added : System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
public void Delete(UserFavoriteResult result) { context.Entry(result).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); }