public void UpdateProfile(Customer customerUpdate, User currentUser) { var customer = context.Customers.SingleOrDefault(user => user.User.Id == currentUser.Id); customer.FirstName = customerUpdate.FirstName; customer.LastName = customerUpdate.LastName; customer.Address = customerUpdate.Address; context.Update(customer); context.SaveChanges(); }
public void UpdateImage(string imagePath, User currentUser) { var shortQuery = from cust in context.Customers where cust.User.Equals(currentUser) select cust; var thisCustomer = shortQuery.First(); thisCustomer.ImagePath = imagePath; context.Update(thisCustomer); context.SaveChanges(); }