public ActionResult Index() { string key = primeKey + "Index:TLiveStreaming"; LiveStreamPageViewModel retorno = null; Func <object, LiveStreamPageViewModel> funcao = t => IndexDB(); retorno = RedisService.GetOrSetToRedis(key, funcao, 60); return(View(retorno)); }
private LiveStreamPageViewModel IndexDB() { var bannerTopo = BannerChave("banner-live-topo"); var bannerBaixo = BannerChave("banner-live-baixo"); var liveStreamingViewModel = new LiveStreamPageViewModel { BannerTopo = bannerTopo == null ? null : new BannerViewModel { Anunciante = bannerTopo.Anunciante, Arquivos = bannerTopo.Arquivo, Chave = bannerTopo.AreaBanner.First().chave, Link = bannerTopo.Link, Titulo = bannerTopo.Titulo, AreaBanner = bannerTopo.AreaBanner }, BannerBaixo = bannerBaixo == null ? null : new BannerViewModel { Anunciante = bannerBaixo.Anunciante, Arquivos = bannerBaixo.Arquivo, Chave = bannerBaixo.AreaBanner.First().chave, Link = bannerBaixo.Link, Titulo = bannerBaixo.Titulo, AreaBanner = bannerBaixo.AreaBanner } }; return(liveStreamingViewModel); }
public LiveStreamPage() { this.InitializeComponent(); ViewModel = this.DataContext as LiveStreamPageViewModel; ViewModel.PropertyChanged += PropChanged; }