protected ContentCollectionBase(UmbracoDataContext dataContext, string contentTypeAlias) { if (dataContext == null) { throw new ArgumentNullException("dataContext"); } //NOTE: This is strange i know but linqpad subclasses our data context in it's own assembly, we need // a ref to our own generated assembly to get th types from that _generatedAssembly = dataContext.GetType().BaseType.Assembly; DataContext = dataContext; _contentTypeAlias = contentTypeAlias; _contentType = GetContentType(contentTypeAlias); if (_contentType == null) { throw new ArgumentException("No content type found with alias " + contentTypeAlias); } }
public ContentQuery(UmbracoDataContext dataContext, string contentTypeAlias) { if (dataContext == null) { throw new ArgumentNullException("dataContext"); } //NOTE: This is strange i know but linqpad subclasses our data context in it's own assembly, we need // a ref to our own generated assembly to get th types from that _generatedAssembly = dataContext.GetType().BaseType.Assembly; _dataContext = dataContext; _contentTypeAlias = contentTypeAlias; _contentType = _dataContext.ApplicationContext.Services.ContentTypeService.GetContentType(contentTypeAlias); if (_contentType == null) { throw new ArgumentException("No content type found with alias " + contentTypeAlias); } _baseQueryable = new DelegateQueryable <T>(DataQuery); }