示例#1
0
        private static UserDto ConvertFromUser(User user)
        {
            UserDto userDto = new UserDto
            {
                Id          = user.Id,
                Name        = user.Name,
                Password    = user.Password,
                RecipeBooks = RecipeBookHelper.ConvertFromRecipeBooks(user.RecipeBooks)
            };

            return(userDto);
        }
示例#2
0
        private static User ConvertToUser(UserDto userDto)
        {
            User user = new User
            {
                Id          = userDto.Id,
                Name        = userDto.Name,
                Password    = userDto.Password,
                RecipeBooks = RecipeBookHelper.ConvertToRecipeBooks(userDto.RecipeBooks)
            };

            return(user);
        }