private User Convert(UserModel userModel) { var user = new User() { Id = userModel.Id, FirstName = userModel.FirstName, LastName = userModel.LastName, BirthDate = userModel.BirthDate, Email = userModel.Email, Login = userModel.Login, Password = userModel.Password, }; return user; }
private UserModel Convert(User user) { var userModel = new UserModel() { Id = user.Id, FirstName = user.FirstName, LastName = user.LastName, BirthDate = user.BirthDate, Email = user.Email, Login = user.Login, Password = user.Password, Roles = user.Roles.Select(r => r.Name) }; return userModel; }