Ejemplo n.º 1
0
        /// <summary>
        /// Loads an instance 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 TModel Load <TModel>(DataModelQuery <TModel> query, bool deep, DataProviderBase provider,
                                           DbTransaction transactionContext) where TModel : DataModel
        {
            if (provider == null)
            {
                provider = ProviderDefaults.AppProvider;
            }
            if (deep)
            {
                return(Load(query, null, provider, transactionContext));
            }
            TModel ret = provider.LoadModel(query, transactionContext);

            return(ret);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads an instance of <typeparamref name="TModel">TModel</typeparamref>.
 /// </summary>
 /// <param name="deep"></param>
 /// <param name="provider"></param>
 /// <param name="transactionContext"></param>
 /// <returns></returns>
 public TModel SelectFirst(bool deep, DataProviderBase provider, DbTransaction transactionContext)
 {
     return(deep ? provider.DeepLoadModel(this, transactionContext)
                 : provider.LoadModel(this, transactionContext));
 }