예제 #1
0
파일: EContentType.cs 프로젝트: rehee/SDHC
 public static bool ContentIsSameType(this IContent content, ContentTypeKey key)
 {
     if (content == null)
     {
         return(false);
     }
     return(content.ContentType.Alias.Equals(key.ToString(), StringComparison.InvariantCultureIgnoreCase));
 }
예제 #2
0
        public static Func <IEnumerable <IContent> > MyGetIContentsByTypeFromService(ContentTypeKey key, IContentService service, IContentTypeService typeService)
        {
            var type = typeService.GetContentType(key.ToString());

            return(() =>
            {
                return service.GetContentOfContentType(type.Id);
            });
        }
예제 #3
0
 public static Func <IDictionary <int, CacheIContent>, IEnumerable <CacheIContent> > MyGetContentByTypeFromCache(ContentTypeKey key)
 {
     return((cacheInput) =>
     {
         var cache = new Dictionary <int, CacheIContent>(cacheInput);
         return cache
         .Where(b => b.Value.Content.ContentType.Alias.Equals(key.ToString(), StringComparison.InvariantCultureIgnoreCase))
         .Select(b => b.Value);
     });
 }
예제 #4
0
 public override string ToString() => contentTypeKey.ToString() + ": " + name;
예제 #5
0
파일: EContentType.cs 프로젝트: rehee/SDHC
 public static string ContentTypeViewPath(this ContentTypeKey type)
 {
     return($"~/Views/{type.ToString()}.cshtml");
 }