Beispiel #1
0
 public ClienteRepository(
     ISelectRepository <Cliente> selectRepository,
     IInsertRepository <Cliente> insertRepository,
     IUpdateRepository <Cliente> updateRepository,
     IDeleteRepository <Cliente> deleteRepository) : base(selectRepository, insertRepository, updateRepository, deleteRepository)
 {
 }
Beispiel #2
0
        public MessagesRepository(StudentifyDbContext context,
                                  ISelectRepository <Message> selectRepository,
                                  IInsertRepository <Message> insertRepository,
                                  IUpdateRepository <Message> updateRepository
                                  ) : base(context)
        {
            Insert = insertRepository;
            Update = updateRepository;
            Select = selectRepository;

            Select.FillWithReferences += async entities =>
            {
                var threads = await Context.Set <Thread>().ToListAsync();

                foreach (var thread in threads)
                {
                    await Context.Entry(thread).Reference(t => t.UserAccount).LoadAsync();

                    await Context.Entry(thread).Collection(t => t.Messages).LoadAsync();
                }
                var users = await Context.Set <StudentifyAccount>().ToListAsync();

                foreach (var user in users)
                {
                    await Context.Entry(user).Reference(i => i.User).LoadAsync();
                }
            };
        }
Beispiel #3
0
        public ThreadsRepository(StudentifyDbContext context,
                                 ISelectRepository <Thread> selectRepository,
                                 IInsertRepository <Thread> insertRepository,
                                 IUpdateRepository <Thread> updateRepository
                                 ) : base(context)
        {
            Insert = insertRepository;
            Update = updateRepository;
            Select = selectRepository;

            Select.FillWithReferences += async entities =>
            {
                await Context.Entry(entities).Reference(t => t.UserAccount).LoadAsync();

                var users = await Context.Set <StudentifyAccount>().ToListAsync();

                foreach (var user in users)
                {
                    await Context.Entry(user).Reference(i => i.User).LoadAsync();
                }

                var studentifyEvents = await Context.Set <StudentifyEvent>().ToListAsync();

                foreach (var studentifyEvent in studentifyEvents)
                {
                    await Context.Entry(studentifyEvent).Reference(i => i.Address).LoadAsync();
                }

                await Context.Entry(entities).Reference(t => t.ReferencedEvent).LoadAsync();

                await Context.Entry(entities).Collection(t => t.Messages).LoadAsync();
            };
        }
Beispiel #4
0
 public TradeOffersRepository(StudentifyDbContext context,
                              ISelectRepository <TradeOffer> selectRepository,
                              IInsertRepository <TradeOffer> insertRepository,
                              IUpdateRepository <TradeOffer> updateRepository
                              ) : base(context, selectRepository)
 {
     Insert = insertRepository;
     Update = updateRepository;
 }
 public MeetingsRepository(StudentifyDbContext context,
                           ISelectRepository <Meeting> selectRepository,
                           IInsertRepository <Meeting> insertRepository,
                           IUpdateRepository <Meeting> updateRepository
                           ) : base(context, selectRepository)
 {
     Insert = insertRepository;
     Update = updateRepository;
 }
Beispiel #6
0
 public InfosRepository(StudentifyDbContext context,
                        ISelectRepository <Info> selectRepository,
                        IInsertRepository <Info> insertRepository,
                        IUpdateRepository <Info> updateRepository
                        ) : base(context, selectRepository)
 {
     Insert = insertRepository;
     Update = updateRepository;
 }
Beispiel #7
0
 public RepositoryBase(
     ISelectRepository <T> selectRepository
     , IInsertRepository <T> insertRepository
     , IUpdateRepository <T> updateRepository
     , IDeleteRepository <T> deleteRepository)
 {
     this.deleteRepository = deleteRepository;
     this.selectRepository = selectRepository;
     this.updateRepository = updateRepository;
     this.insertRepository = insertRepository;
 }
        public StudentifyAccountsRepository(StudentifyDbContext context,
                                            ISelectRepository <StudentifyAccount> selectRepository,
                                            IUpdateRepository <StudentifyAccount> updateRepository,
                                            IInsertRepository <StudentifyAccount> insertRepository) : base(context)
        {
            Update = updateRepository;
            Select = selectRepository;
            Select.FillWithReferences += async entities =>
            {
                await Context.Entry(entities).Reference(i => i.User).LoadAsync();

                await Context.Entry(entities).Collection(i => i.Skills).LoadAsync();
            };
            Insert = insertRepository;
        }
Beispiel #9
0
        public SkillsRepository(StudentifyDbContext context,
                                ISelectRepository <Skill> selectRepository,
                                IInsertRepository <Skill> insertRepository,
                                IUpdateRepository <Skill> updateRepository
                                ) : base(context)
        {
            Insert = insertRepository;
            Update = updateRepository;
            Select = selectRepository;

            Select.FillWithReferences += async entities =>
            {
                await Context.Entry(entities).Reference(t => t.Owner).LoadAsync();

                //await Context.Entry(entities).Collection(m => m.).LoadAsync();
                var users = await Context.Set <StudentifyAccount>().ToListAsync();

                foreach (var user in users)
                {
                    await Context.Entry(user).Reference(i => i.User).LoadAsync();
                }
            };
        }
Beispiel #10
0
 public StudentifyEventsRepository(StudentifyDbContext context,
                                   ISelectRepository <StudentifyEvent> selectRepository,
                                   IDeleteRepository <StudentifyEvent> deleteRepository) : base(context, selectRepository)
 {
     Delete = deleteRepository;
 }
 public StudentifyEventRepositorySelectBase(StudentifyDbContext context, ISelectRepository <T> selectRepository) : base(context)
 {
     Select = selectRepository;
     Select.FillWithReferences += FillWithReferences;
 }
 public BlogController(ISelectRepository <BlogEntry> repository)
 {
     _repository = repository;
 }