Пример #1
0
        /// <summary>
        /// 初始化 <see cref="DefaultRepositoryProvider"/> 类的新实例。
        /// </summary>
        /// <param name="context"></param>
        public DefaultRepositoryProvider(InternalContext context)
        {
            this.context = context;
            var entityQueryProvider = new EntityQueryProvider(context);

            context.As <IEntityPersistentInstanceContainer>(s => entityQueryProvider.InitializeInstanceName(s.InstanceName));
            QueryProvider = new QueryProvider(entityQueryProvider);
            Queryable     = new QuerySet <TEntity>(QueryProvider, null);
        }
Пример #2
0
        /// <summary>
        /// 使用一个 <see cref="IDatabase"/> 对象初始化 <see cref="EntityQueryProvider"/> 类的新实例。
        /// </summary>
        /// <param name="context">一个 <see cref="InternalContext"/> 对象。</param>
        internal EntityQueryProvider(InternalContext context)
        {
            Guard.ArgumentNull(context, "context");

            this.context = context;
        }