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