Ejemplo n.º 1
0
        private void Initialize()
        {
            _attributesScope = new EagerAttributeProcessor()
                               .MarkEagers <StorageEntity>(this);

            DbProvider = new Provider <IUnitOfWork>(() => new UnitOfWork());
        }
Ejemplo n.º 2
0
        public RepositoryBase(IDataset <Entity> dbset)
        {
            DbSet = dbset;

            _attributesScope = new EagerAttributeProcessor()
                               .MarkEagers <Entity>(this);
        }
Ejemplo n.º 3
0
        private EagerScopeManager MarkEagersList <StorageEntity>(List <Eager> eagers)
            where StorageEntity : class
        {
            if (eagers.Count > 0)
            {
                var scope = new EagerScopeManager();

                var type = typeof(StorageEntity);

                foreach (var eager in eagers)
                {
                    if (eager.EntityType == type)
                    {
                        if (eager.PropertyNames.Length == 0)
                        {
                            scope.Mark <StorageEntity>();
                        }
                        foreach (string prop in eager.PropertyNames)
                        {
                            scope.Mark <StorageEntity>(q => q.Include(prop));
                        }
                    }
                }

                return(scope);
            }

            return(null);
        }
Ejemplo n.º 4
0
 public AttributeEagerScopeManager(IDisposable parent)
 {
     _attributesScope = new EagerAttributeProcessor()
                        .MarkEagers <Entity>(parent);
 }
Ejemplo n.º 5
0
 protected IQueryable <Entity> ApplyEagerMarking(IQueryable <Entity> queryable)
 {
     return(EagerScopeManager.Apply(queryable));
 }