示例#1
0
 public UserForListOfUsersModel Map(Domain.Models.User user)
 {
     return(new UserForListOfUsersModel
     {
         Id = user.Id,
         Name = user.Name,
         Email = user.Email,
         Roles = user.Roles.Select(item => _roleMapper.Map(item)).ToList()
     });
 }
示例#2
0
        public TransferUser Map(User user)
        {
            if (user == null)
            {
                return(null);
            }
            return(new TransferUser
            {
                UserId = user.UserId,
                Login = user.Login,
                PrompterStatus = user.PrompterStatus,
                Password = user.Password,
                Disabled = user.Disabled,

                RoleId = user.RoleId,

                Role = _roleMapper.Map(user.Role),

                EntityState = EntityState.Unchanged
            });
        }