示例#1
0
        public async Task RegisterCustomerUser(ApplicationUser user, RegisterModel model)
        {
            var customer = new Customer
            {
                id       = user.Id,
                imgSrc   = $"{GlobalProperties.GetUsersImagesPath(_httpContext)}{GlobalVariables.DefaultUserImageName}",
                fullName = model.fullName
            };

            _context.Customers.Add(customer);
            if (await _context.SaveChangesAsync() != 1)
            {
                throw new Exception("cannot add customer user");
            }
        }