Ejemplo n.º 1
0
        public ManagerEmployeesQueryAggregate(DataAccess.RepositoryContext context) : base(context, null)
        {
            GetEmployeesLoadOperation = new GetCollectionLinkedEntityQueryOperation <PersonEntity3>
            {
                //GetLinkedEntities = (repository, entity, user) =>
                //    ((PersonQueryRepository4)repository).GetForManager(RootEntity.Id, user).ToList(),

                GetLinkedEntitiesAsync = async(repository, entity, user) =>
                {
                    var entities = await((PersonQueryRepository4)repository).GetForManagerAsync(RootEntity.Id);

                    return(entities.ToList());
                }
            };

            QueryOperations.Enqueue(
                GetEmployeesLoadOperation
                );
        }
Ejemplo n.º 2
0
        public ClassEnrollmentQueryAggregate(RepositoryContext context) : base(context, null)
        {
            GetStudentsLoadOperation = new GetCollectionLinkedEntityQueryOperation <StudentEntity>
            {
                GetLinkedEntities = (repository, entity, user) =>
                                    ((StudentQueryRepository)repository).GetForClass(RootEntity.Id).ToList(),

                GetLinkedEntitiesAsync = async(repository, entity, user) =>
                {
                    var entities = await((StudentQueryRepository)repository).GetForClassAsync(RootEntity.Id);

                    return(entities.ToList());
                }
            };

            QueryOperations.Enqueue(
                GetStudentsLoadOperation
                );
        }
        public BookPagesQueryAggregate(RepositoryContext context) : base(context, null)
        {
            GetPagesLoadOperation = new GetCollectionLinkedEntityQueryOperation <PageEntity>
            {
                GetLinkedEntities = (repository, entity, user) =>
                                    ((PageQueryRepository)repository).GetForBook(RootEntity.Id).ToList(),

                GetLinkedEntitiesAsync = async(repository, entity, user) =>
                {
                    var entities = await((PageQueryRepository)repository).GetForBookAsync(RootEntity.Id);

                    return(entities.ToList());
                }
            };

            QueryOperations.Enqueue(
                GetPagesLoadOperation
                );
        }
Ejemplo n.º 4
0
        public PersonFriendsQueryAggregate(RepositoryContext context) : base(context, null)
        {
            GetFriendsLoadOperation = new GetCollectionLinkedEntityQueryOperation <PersonEntity>
            {
                GetLinkedEntities = (repository, entity, user) =>
                                    ((PersonQueryRepository3)repository).GetForPerson(RootEntity.Id).ToList(),

                GetLinkedEntitiesAsync = async(repository, entity, user) =>
                {
                    var entities = await((PersonQueryRepository3)repository).GetForPersonAsync(RootEntity.Id);

                    return(entities.ToList());
                }
            };

            QueryOperations.Enqueue(
                GetFriendsLoadOperation
                );
        }