Пример #1
0
 private IEnumerable <T> GetContents <T>(SectionContentBase.Types type) where T : SectionContent
 {
     if (SectionContents != null)
     {
         return(SectionContents.Where(m => m != null && m.SectionContentType == (int)type).OrderBy(m => m.Order).Cast <T>());
     }
     return(null);
 }
Пример #2
0
 private T GetContent <T>(SectionContentBase.Types type) where T : SectionContent
 {
     if (SectionContents != null)
     {
         return(SectionContents.FirstOrDefault(m => m != null && m.SectionContentType == (int)type) as T);
     }
     return(null);
 }