예제 #1
0
        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();
        }
예제 #2
0
        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();
        }