Beispiel #1
0
        public async Task <UserDto> CreateAsync(UserDto user)
        {
            var dataModel = user.Convert();

            await this.repo.Users.AddAsync(dataModel);

            await this.repo.SaveChangesAsync();

            return(dataModel.Convert());
        }
Beispiel #2
0
        public UserDto GetUser(int id)
        {
            IUser user = this._userRepository.GetUser(id);

            if (user != null)
            {
                UserDto u = UserDto.Convert(user);
                u.Credential = user.GetCredential();
                u.Roles      = user.GetAppRole();
                return(u);
            }
            return(null);
        }