public void ListScheduleByRange()
        {
            PerformanceDetailsBaseDTO performanceDetailsExpected =
                performanceDetailsService.LoadPerformanceDetails(phoneId, languageCode, performanceId);

            Assert.AreEqual(performanceDetailsExpected, performance, "Performance are not equels");
        }
Exemple #2
0
        public ActionResult <PerformanceDetailsBaseDTO> GetInfo(
            string Accountid, string languageCode, int performanceId)
        {
            PerformanceDetailsBaseDTO performanceDetails = performanceDetailsService
                                                           .LoadPerformanceDetails(Accountid, languageCode, performanceId);

            if (performanceDetails == null)
            {
                return(NotFound());
            }
            return(StatusCode(200, performanceDetails));
        }
Exemple #3
0
        public PerformanceDetailsBaseDTO LoadPerformanceDetails(string Accountid, string languageCode, int performanceId)
        {
            var cacheProvider = new CacheProvider(memoryCache);

            var isChecked = isCheckedPerformanceRepository.IsChecked(Accountid, performanceId);

            performanceDetailsRequest = cacheProvider.GetAndSave(
                () => GetCacheKey(languageCode, performanceId),
                () =>
            {
                var performance = performanceDetailsRepository
                                  .GetInformationAboutPerformance(Accountid, languageCode, performanceId)
                                  as PerformanceDetailsDataModelWp;

                var tags         = tagRepository.GetTagsByPerformanceId(performanceId).Result;
                var creativeTeam = creativeTeamRepository.GetCreativeTeam(languageCode, performanceId);

                performanceDetailsRequest = new PerformanceDetailsWpDTO()
                {
                    Title        = performance.Title,
                    Duration     = performance.Duration,
                    MinimumAge   = performance.MinimumAge,
                    MinPrice     = performance.MinPrice,
                    MaxPrice     = performance.MaxPrice,
                    Description  = performance.Description,
                    MainImage    = performance.MainImage,
                    GalleryImage = performance.GalleryImage,
                    HashTag      = from tg in tags
                                   select tg,
                    TeamMember = from tm in creativeTeam
                                 select new TeamMemberDTO()
                    {
                        FirstName = tm.FirstName,
                        LastName  = tm.LastName,
                        Role      = tm.Role,
                        RoleKey   = tm.RoleKey,
                    },
                };

                return(performanceDetailsRequest);
            });

            performanceDetailsRequest.IsChecked = isChecked;

            return(performanceDetailsRequest);
        }