コード例 #1
0
ファイル: PostService.cs プロジェクト: ljvblfz/MicrosoftOxite
 public Post GetPost(string blogName, string postSlug)
 {
     return(cache.GetItem <Post>(
                string.Format("GetPost-Blog:{0},Post:{1}", blogName, postSlug),
                () => pluginEngine.ProcessDisplayOfPost(context, () => repository.GetPost(blogName, postSlug).FillTags(tagService).FillComments(commentService)),
                p => p.GetDependencies()
                ));
 }
コード例 #2
0
 public bool GetBlogExists(string blogName)
 {
     return(cache.GetItem <bool?>(
                string.Format("GetBlogExists-Name:{0}", blogName),
                () => repository.GetBlog(blogName) != null,
                null
                ).GetValueOrDefault(false));
 }
コード例 #3
0
 public UserAuthenticated GetUser(string name)
 {
     return(cache.GetItem <UserAuthenticated>(
                string.Format("GetUser-UserName:{0}", name),
                () => repository.GetUser(context.Site.ID, name),
                null
                ));
 }
コード例 #4
0
 public ScheduleItem GetScheduleItem(Event evnt, string scheduleItemSlug)
 {
     return(cache.GetItem <ScheduleItem>(
                string.Format("GetScheduleItem-Event:{0},ScheduleItem:{1}", evnt.Name, scheduleItemSlug),
                () => repository.GetScheduleItem(evnt, scheduleItemSlug).FillTags(tagService).FillComments(commentService),
                si => si.GetDependencies()
                ));
 }
コード例 #5
0
ファイル: UserService.cs プロジェクト: ljvblfz/MicrosoftOxite
 public User GetUser(string name)
 {
     return(cache.GetItem <User>(
                string.Format("GetUser-UserName:{0}", name),
                () => repository.GetUser(name),
                null
                ));
 }
コード例 #6
0
        public ScheduleItem GetScheduleItem(ScheduleItemAddress scheduleItemAddress)
        {
            var result =
                cache.GetItem <ScheduleItem>(
                    string.Format("GetScheduleItem-Event:{0},ScheduleItem:{1}", scheduleItemAddress.EventName, scheduleItemAddress.ScheduleItemSlug),
                    () => repository.GetScheduleItem(scheduleItemAddress.EventName, scheduleItemAddress.ScheduleItemSlug).FillTags(tagService).FillComments(commentService),
                    si => si.GetDependencies()
                    );

            SetScheduleItemUsers(result);

            return(result);
        }
コード例 #7
0
 public bool GetEventExists(string eventName)
 {
     return(cache.GetItem <bool?>(
                string.Format("GetEventExists-Name:{0}", eventName),
                () => repository.GetEvent(eventName) != null,
                null
                ).GetValueOrDefault(false));
 }
コード例 #8
0
ファイル: SiteService.cs プロジェクト: ljvblfz/MicrosoftOxite
        public Site GetSite()
        {
            string instanceName = !string.IsNullOrEmpty(config.InstanceName) ? config.InstanceName : "Oxite";

            return
                (cache != null
                ? cache.GetItem <Site>("GetSite", () => repository.GetSite(instanceName), null)
                : repository.GetSite(instanceName));
        }
コード例 #9
0
ファイル: SiteService.cs プロジェクト: ljvblfz/MicrosoftOxite
        public Site GetSite()
        {
            string instanceName = appSettings.GetInstanceName();

            return
                (cache != null
                ? cache.GetItem <Site>("GetSite", () => repository.GetSite(instanceName), null)
                : repository.GetSite(instanceName));
        }