public static UserLoginPassOutputModel ToOutputModel(User currentUser) { return(new UserLoginPassOutputModel { Id = (int)currentUser.Id, Login = currentUser.Login, Roles = RoleMapper.ToOutputModels(currentUser.Roles) }); }
public static UsersWithSomeRoleOutputModel ToOutputModel(User user) { var result = new UsersWithSomeRoleOutputModel { Id = (int)user.Id, FirstName = user.FirstName, Patronymic = user.Patronymic, BirthDate = user.BirthDate.ToString(), Email = user.Email, Phone = user.Phone, Bio = user.Bio, City = CityMapper.ToOutputModel(user.City).Name, RegistrationDate = user.RegistrationDate.ToString(), Roles = RoleMapper.ToOutputModels(user.Roles) }; return(result); }