コード例 #1
0
        public ProfilePageViewModel MapFrom(Profile input)
        {
            var viewModel = Mapper.Map<Profile, ProfilePageViewModel>(input);

            viewModel.Assertions =
                input.Assertions.OrderBy(a => a.Category.SortOrder.ToString("00000") + a.Tag.Name).ToList().MapAllUsing(
                    this.profileAssertionViewModelMapper);

            return this.pageViewModelBuilder.UpdateSiteProperties(viewModel);
        }
コード例 #2
0
        public ProfilePageViewModel MapFrom(
            Profile input,
            IList<Category> categories)
        {
            var viewModel = this.MapFrom(input);

            this.AddCategoriesTo(
                viewModel,
                categories);

            return viewModel;
        }
        public UpdateProfilePageViewModel MapFrom(
            Profile input,
            IList <Category> categories)
        {
            var viewModel = Mapper.Map <Profile, UpdateProfilePageViewModel>(input);

            viewModel.Assertions = input.Assertions
                                   .OrderBy(a => a.Category.SortOrder.ToString("00000") + a.Tag.Name)
                                   .ToList()
                                   .MapAllUsing(this.profileAssertionViewModelMapper);

            this.AddCategoriesTo(
                viewModel,
                categories);

            return(this.pageViewModelBuilder.UpdateSiteProperties(viewModel));
        }