Exemple #1
0
        public NHibernateNodeTypeProvider()
        {
            var methodInfoRegistry = new MethodInfoBasedNodeTypeRegistry();

            methodInfoRegistry.Register(
                new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.Fetch, default(IQueryable <object>), default(Expression <Func <object, object> >)) },
                typeof(FetchOneExpressionNode));
            methodInfoRegistry.Register(
                new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.FetchLazyProperties, default(IQueryable <object>)) },
                typeof(FetchLazyPropertiesExpressionNode));
            methodInfoRegistry.Register(
                new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.FetchMany, default(IQueryable <object>), default(Expression <Func <object, IEnumerable <object> > >)) },
                typeof(FetchManyExpressionNode));
            methodInfoRegistry.Register(
                new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.ThenFetch, default(INhFetchRequest <object, object>), default(Expression <Func <object, object> >)) },
                typeof(ThenFetchOneExpressionNode));
            methodInfoRegistry.Register(
                new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.ThenFetchMany, default(INhFetchRequest <object, object>), default(Expression <Func <object, IEnumerable <object> > >)) },
                typeof(ThenFetchManyExpressionNode));
            methodInfoRegistry.Register(
                new[]
            {
                ReflectHelper.FastGetMethodDefinition(LinqExtensionMethods.WithLock, default(IQueryable <object>), default(LockMode)),
                ReflectHelper.FastGetMethodDefinition(LinqExtensionMethods.WithLock, default(IEnumerable <object>), default(LockMode))
            },
                typeof(LockExpressionNode));

            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            nodeTypeProvider.InnerProviders.Add(methodInfoRegistry);
            defaultNodeTypeProvider = nodeTypeProvider;
        }
Exemple #2
0
 public AllHqlGenerator()
 {
     SupportedMethods = new[]
     {
         ReflectionCache.QueryableMethods.AllDefinition,
         ReflectHelper.FastGetMethodDefinition(Enumerable.All, default(IEnumerable <object>), default(Func <object, bool>))
     };
 }
Exemple #3
0
 public CollectionContainsGenerator()
 {
     SupportedMethods = new[]
     {
         ReflectHelper.FastGetMethodDefinition(Queryable.Contains, default(IQueryable <object>), default(object)),
         ReflectHelper.FastGetMethodDefinition(Enumerable.Contains, default(IEnumerable <object>), default(object))
     };
 }