Exemple #1
0
        /// <summary>
        /// Loads an instance of <see cref="DataModel{TEntity}"/>.
        /// </summary>
        /// <param name="query"></param>
        /// <param name="deep"></param>
        /// <param name="provider"></param>
        /// <param name="transactionContext"></param>
        /// <returns></returns>
        public static DataModelCollection <DataModel <TEntity> > LoadMany(DataModelQuery <DataModel <TEntity> > query, bool deep,
                                                                          DataProviderBase provider, DbTransaction transactionContext)
        {
            if (provider == null)
            {
                provider = ProviderDefaults.AppProvider;
            }
            if (deep)
            {
                return(LoadMany(query, null, provider, transactionContext));
            }
            var col = provider.LoadModels(query, transactionContext);
            var ret = new DataModelCollection <DataModel <TEntity> >(col);

            return(ret);
        }
Exemple #2
0
        /// <summary>
        /// Loads instances of <typeparamref name="TModel"/>.
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="query"></param>
        /// <param name="deep"></param>
        /// <param name="provider"></param>
        /// <param name="transactionContext"></param>
        /// <returns></returns>
        public static DataModelCollection <TModel> LoadMany <TModel>(DataModelQuery <TModel> query, bool deep,
                                                                     DataProviderBase provider,
                                                                     DbTransaction transactionContext)
            where TModel : DataModel
        {
            if (provider == null)
            {
                provider = ProviderDefaults.AppProvider;
            }
            if (deep)
            {
                return(LoadMany(query, null, provider, transactionContext));
            }
            DataModelCollection <TModel> ret = provider.LoadModels(query, transactionContext);

            return(ret);
        }
Exemple #3
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));
 }