internal IncludableQueryable(IQueryable <T> query, IRootAccessor <T> rootAccessor) { LinqToDBQuery = query as IExpressionQuery <T>; if (LinqToDBQuery == null) { throw new ArgumentException("IQueryable<T> must be of type LinqToDB.Linq.IExpressionQuery<T>"); } var context = query.GetDataContext <IDataContext>(); _rootAccessor = rootAccessor; }
internal IncludableQueryable(IQueryable <T> query) { LinqToDBQuery = query as IExpressionQuery <T>; if (LinqToDBQuery == null) { throw new ArgumentException("IQueryable<T> must be of type LinqToDB.Linq.IExpressionQuery<T>"); } var context = query.GetDataContext <IDataContext>(); _rootAccessor = new RootAccessor <T>(context.MappingSchema); _builder = new Builder(context.MappingSchema); }
internal static PropertyAccessor <TEntity, TProperty> Create <TEntity, TProperty> (MemberExpression exp, IPropertyAccessor parentAccessor, IRootAccessor root) where TEntity : class where TProperty : class { var pathParts = PathWalker.GetPath(exp); var newAccessor = root.GetByPath <TEntity, TProperty>(pathParts) ?? new PropertyAccessor <TEntity, TProperty>(exp, root.MappingSchema); if (parentAccessor != null && !newAccessor.Properties.Contains(parentAccessor)) { var genericParentAccessor = (IPropertyAccessor <TProperty>)parentAccessor; newAccessor.PropertiesOfTClass.Add(genericParentAccessor); } return(newAccessor); }
internal PropertyVisitor(IRootAccessor <TClass> rootAccessor) { _rootAccessor = rootAccessor; }