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); }
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); }