Пример #1
0
        public async Task <HomePageModel> ModelAsync()
        {
            const int BLOG_POST_COUNT = 2;

            return(new HomePageModel
            {
                Services = await _serviceInfoService.GetServiceInfosAsync(),
                TeamMembers = (await _userService.GetDisplayedTeamMembersAsync()).Select(user =>
                {
                    var profile = user.Profile;
                    profile.UpdatePersonalInfo(
                        profile.FirstName,
                        profile.LastName,
                        profile.JobPosition,
                        Url.Content(profile.PhotoFilePath));
                    return user;
                }),
                Works = (await _workExampleService.GetWorkExamplesAsync()).Select(workExample =>
                {
                    workExample.ImagePath = Url.Content(workExample.ImagePath);
                    return workExample;
                }),
                BlogPosts = (await _blogService.GetBlogPostsAsync(skip: 0, take: BLOG_POST_COUNT)).Select(blogPost =>
                {
                    blogPost.ImagePath = Url.Content(blogPost.ImagePath);
                    return blogPost;
                }),
                Brands = (await _brandService.GetBrandsAsync()).Select(brand =>
                {
                    brand.ImagePath = Url.Content(brand.ImagePath);
                    return brand;
                }),
                Testimonials = await _testimonialService.GetTestimonialsAsync(),
                Contacts = await _contactsService.GetContactsAsync(),
                SocialLinks = (await _contactsService.GetSocialLinksAsync()).Select(x => new SocialLink(x.Key, x.Value))
            });
        }
Пример #2
0
 protected override async Task <IEnumerable <Testimonial> > PerformGetManyAsync()
 {
     return(await _testimonialService.GetTestimonialsAsync());
 }