public async Task Add(D.User user) { var customer = await _cspDbContext.Customer.FirstOrDefaultAsync(x => x.Guid == user.CustomerId); var role = await _cspDbContext.Role.FirstOrDefaultAsync(x => x.Id == user.RoleId); var userData = _mapper.Map <E.User>(user); userData.Customer = customer; _cspDbContext.User.Add(userData); await _cspDbContext.SaveChangesAsync(); }
public async Task Add(D.Customer customer) { _cspDbContext.Customer.Add(_mapper.Map <E.Customer>(customer)); await _cspDbContext.SaveChangesAsync(); }