Beispiel #1
0
        public async Task RemoveAsync(Guid userId)
        {
            var dto = await _userQuery.GetAsync(userId);

            if (dto != null)
            {
                var entry = _mapper.Map <User>(dto);
                entry.IsDeleted = true;
                _db.User.Attach(entry);
                _db.Entry(entry).Property(x => x.IsDeleted).IsModified = true;
                await _db.SaveChangesAsync();
            }
        }
Beispiel #2
0
        public async Task <User> GetItemAsync(Guid id)
        {
            var item = await _userQuery.GetAsync(id);

            if (item == null)
            {
                return(null);
            }

            return(new User
            {
                Id = item.Id,
                Username = item.Username,
                EMail = item.EMail,
            });
        }
Beispiel #3
0
 /// <inheritdoc />
 public async Task <User> GetAsync(Guid id)
 {
     return(await _userQuery.GetAsync(id));
 }
Beispiel #4
0
 public async Task <UserDto> GetDetails(Guid id)
 {
     return(await _userQuery.GetAsync(id));
 }