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