Пример #1
0
        /// <summary>
        /// Loads instances of <typeparamref name="TModel"/>.
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="query"></param>
        /// <param name="depth"></param>
        /// <param name="provider"></param>
        /// <param name="transactionContext"></param>
        /// <returns></returns>
        public static DataModelCollection <TModel> LoadMany <TModel>(DataModelQuery <TModel> query, int?depth,
                                                                     DataProviderBase provider,
                                                                     DbTransaction transactionContext)
            where TModel : DataModel
        {
            DataModelCollection <TModel> ret = depth.HasValue
                ? provider.DeepLoadModels(query, depth, transactionContext)
                : provider.DeepLoadModels(query, transactionContext);

            return(ret);
        }
Пример #2
0
        /// <summary>
        /// Loads an instance of <see cref="DataModel{TEntity}"/>.
        /// </summary>
        /// <param name="query"></param>
        /// <param name="depth"></param>
        /// <param name="provider"></param>
        /// <param name="transactionContext"></param>
        /// <returns></returns>
        public static DataModelCollection <DataModel <TEntity> > LoadMany(DataModelQuery <DataModel <TEntity> > query, int?depth,
                                                                          DataProviderBase provider, DbTransaction transactionContext)
        {
            DataModelCollection <DataModel <TEntity> > col;

            if (depth.HasValue)
            {
                col = provider.DeepLoadModels(query, depth, transactionContext);
            }
            else
            {
                col = provider.DeepLoadModels(query, transactionContext);
            }
            var ret = new DataModelCollection <DataModel <TEntity> >(col);

            return(ret);
        }
Пример #3
0
 /// <summary>
 /// Loads instances of <typeparamref name="TModel">TModel</typeparamref>.
 /// </summary>
 /// <param name="depth"></param>
 /// <param name="provider"></param>
 /// <param name="transactionContext"></param>
 /// <returns></returns>
 public DataModelCollection <TModel> SelectMany(int?depth, DataProviderBase provider,
                                                DbTransaction transactionContext)
 {
     return(provider.DeepLoadModels(this, depth, transactionContext));
 }
Пример #4
0
 /// <summary>
 /// Loads instances of <typeparamref name="TModel">TModel</typeparamref>.
 /// </summary>
 /// <param name="deep"></param>
 /// <param name="provider"></param>
 /// <param name="transactionContext"></param>
 /// <returns></returns>
 public DataModelCollection <TModel> SelectMany(bool deep, DataProviderBase provider,
                                                DbTransaction transactionContext)
 {
     return(deep ? provider.DeepLoadModels(this, transactionContext)
                 : provider.LoadModels(this, transactionContext));
 }