Exemple #1
0
        public async Task Update(D.User user)
        {
            var userData = await _cspDbContext.User.FirstOrDefaultAsync(x => x.Guid == user.Id);

            userData.Password = user.Password;
            _cspDbContext.User.Update(userData);
            await _cspDbContext.SaveChangesAsync();
        }
Exemple #2
0
        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();
        }