コード例 #1
0
 public async override Task PreRender()
 {
     if (!ShowVideo)
     {
         if (!string.IsNullOrEmpty(Context.Parameters["Id"].ToString()) && !string.IsNullOrEmpty(Context.Parameters["Name"].ToString()))
         {
             PornRepository PornRep = new PornRepository();
             try
             {
                 Id   = Convert.ToInt16(Context.Parameters["Id"].ToString());
                 Name = Context.Parameters["Name"].ToString();
             }
             catch
             {
                 Context.RedirectToRoute("Default");
             }
             if (Videos.IsFirstPage)
             {
                 CategoryCount = await PornRep.GetCategoryVideosCount(Id);
             }
             Videos.OnLoadingData = option => PornRep.GetVideosByCategory(option, Id, VideoSwitch, LoadMobile, currentCulture);
         }
     }
     await base.PreRender();
 }
コード例 #2
0
        public async Task LoadVideo(VideoListDTO video)
        {
            PornRepository PornRep = new PornRepository();

            ShowVideo = true;
            Video     = await PornRep.GetVideoByIdAsync(video.Id, currentCulture);
        }
コード例 #3
0
        public async override Task PreRender()
        {
            PornRepository PornRep = new PornRepository();

            Categories = await PornRep.GetAllCategoriesAsync(currentCulture);

            await base.PreRender();
        }
コード例 #4
0
        public async Task LoadSuggestedVideos(string currentCulture)
        {
            PornRepository rep = new PornRepository();

            SuggestedVideos = await rep.GetSuggestedVideosAsync(Categories.Select(x => x.Id).ToList(), this.Id, currentCulture);
        }