コード例 #1
0
ファイル: PageViewRepository.cs プロジェクト: zyq524/Habitat
 public PageView Get(ICurrentPageContext pageContext)
 {
     return(new PageView()
     {
         Duration = GetDuration(pageContext),
         HasEngagementValue = pageContext.PageEvents.Any(pe => pe.Value > 0),
         HasMvTest = HasMvTest(pageContext),
         HasPersonalisation = HasPersonalisation(pageContext),
         Path = GetCleanPath(pageContext)
     });
 }
コード例 #2
0
ファイル: PageViewRepository.cs プロジェクト: zyq524/Habitat
 public PageView Get(ICurrentPageContext pageContext)
 {
   return new PageView()
          {
            Duration = GetDuration(pageContext),
            HasEngagementValue = pageContext.PageEvents.Any(pe => pe.Value > 0),
            HasMvTest = HasMvTest(pageContext),
            HasPersonalisation = HasPersonalisation(pageContext),
            Path = GetCleanPath(pageContext)
   };
 }
コード例 #3
0
 private TimeSpan GetDuration(ICurrentPageContext pageContext)
 {
     return(TimeSpan.FromMilliseconds(pageContext.Duration));
 }
コード例 #4
0
 private static bool HasMvTest(ICurrentPageContext pageContext)
 {
     return(pageContext.MvTest != null && !pageContext.MvTest.IsSuspended && pageContext.MvTest.EligibleRules != null && pageContext.MvTest.EligibleRules.Any());
 }
コード例 #5
0
 private static bool HasPersonalisation(ICurrentPageContext pageContext)
 {
     return(pageContext.Personalization != null && pageContext.Personalization.ExposedRules != null && pageContext.Personalization.ExposedRules.Any());
 }
コード例 #6
0
 public PageMetadataQueryHandler(ICurrentPageContext currentPageContext, IMapper mapper, IMediator mediator)
 {
     this.currentPageContext = currentPageContext;
     this.mapper             = mapper;
     this.mediator           = mediator;
 }
コード例 #7
0
 private TimeSpan GetDuration(ICurrentPageContext pageContext)
 {
   return TimeSpan.FromMilliseconds(pageContext.Duration);
 }
コード例 #8
0
 private static bool HasMvTest(ICurrentPageContext pageContext)
 {
   return pageContext.MvTest != null && !pageContext.MvTest.IsSuspended && pageContext.MvTest.EligibleRules != null && pageContext.MvTest.EligibleRules.Any();
 }
コード例 #9
0
 private static bool HasPersonalisation(ICurrentPageContext pageContext)
 {
   return pageContext.Personalization != null && pageContext.Personalization.ExposedRules != null && pageContext.Personalization.ExposedRules.Any();
 }
コード例 #10
0
 public SetCurrentPageRequestPostProcessor(ICurrentPageContext currentPageContext)
 {
     this.currentPageContext = currentPageContext;
 }