public AuthService(IRepositoryAuth repositoryAuth, IRepositoryGeneric repositoryGeneric, IConfiguration configuration, IMapper mapper)
 {
     _repositoryAuth    = repositoryAuth;
     _repositoryGeneric = repositoryGeneric;
     _configuration     = configuration;
     _mapper            = mapper;
 }
Esempio n. 2
0
        public EFTransactionRepository(BaseContext dbContext)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException($"{nameof(dbContext)} can not be null");
            }

            _dbContext = dbContext;
            repository = new EFRepositoryGeneric <T>(_dbContext);
        }
        public void CreateMessage()
        {
            //DataBaseInitializer<MessageContext>.InitializedDatabase();

            using (BaseContext context = ContextFactory.Create())
            {
                IUnitOfWork uow = new EFUnitOfWork(context);

                IRepositoryGeneric <User> userRepository = uow.GetRepository <User>();//Veri tabanımızı oluşturuyoruz. Varsa default değerleri de insertliyoruz.
                User user1 = new User()
                {
                    Name = "Berkay"
                };
                User user2 = new User()
                {
                    Name = "Arda"
                };
                userRepository.Add(user1);
                userRepository.Add(user2);

                uow.SaveChanges();

                IRepositoryGeneric <Message> msgRepository = uow.GetRepository <Message>();
                msgRepository.Add(new Message()
                {
                    FromUser = user1, ToUser = user2, Text = $"Selam. Nasılsın?", CreateDate = DateTime.Now
                });
                msgRepository.Add(new Message()
                {
                    FromUser = user2, ToUser = user1, Text = $"İyiyim", CreateDate = DateTime.Now
                });
                uow.SaveChanges();

                Console.WriteLine("Tüm mesajlar cekiliyor...");
                foreach (var msg in msgRepository.GetAll())
                {
                    Console.WriteLine(msg.ToString());
                    System.Diagnostics.Debug.WriteLine(msg.Text.ToString());
                    HttpContext.Current.Response.Write(msg.Text.ToString());
                }

                Console.WriteLine("Berkay'ın mesajları çekiliyor");
                foreach (var msg in msgRepository.GetAll((m) => m.FromUser.Name == "Berkay"))
                {
                    Console.WriteLine(msg.ToString());
                    System.Diagnostics.Debug.WriteLine(msg.Text.ToString());
                    HttpContext.Current.Response.Write(msg.Text.ToString());
                }
            }
        }
Esempio n. 4
0
 public UnitOfWork(DatabaseContext ContextDB,
                   IRepositoryGeneric <Message, MessageEF, int> iMessageRepository,
                   IRepositoryGeneric <Conversation, ConversationEF, int> iConversationRepository,
                   IRepositoryGeneric <Adress, AdressEF, int> iAdressRepository,
                   IRepositoryGeneric <MovieSummary, MovieEF, int> iMovieSummaryRepository,
                   IRepositoryGeneric <MovieDetail, MovieEF, int> iMovieDetailRepository,
                   IRepositoryGeneric <ApplicationUserEF, ApplicationUserEF, string> iUserRepository)
 {
     ConversationRepository = iConversationRepository;
     MessageRepository      = iMessageRepository;
     AdressRepository       = iAdressRepository;
     MovieSummaryRepository = iMovieSummaryRepository;
     MovieDetailRepository  = iMovieDetailRepository;
     UserRepository         = iUserRepository;
     contextDB = ContextDB;
 }
Esempio n. 5
0
        public UnitOfWork(
            ShoppingContext shoppingContext,
            IRepositoryGeneric <Order> ordersRepository,
            IRepositoryGeneric <Product> productsRepository,
            IRepositoryGeneric <OrderLine> orderLinesRepository
            )
        {
            if (shoppingContext == null)
            {
                _shoppingContext = new ShoppingContext();
            }

            _shoppingContext      = shoppingContext;
            _ordersRepository     = ordersRepository;
            _productsRepository   = productsRepository;
            _orderLinesRepository = orderLinesRepository;
        }
Esempio n. 6
0
 public IRepositoryGeneric <Curriculum, int> GetCurriculumRepository()
 {
     return(_curriculumRepository ?? (_curriculumRepository = new RepositoryGeneric <Curriculum, int>(_context)));
 }
Esempio n. 7
0
 public IRepositoryGeneric <Speciality, int> GetSpecialityRepository()
 {
     return(_specialityRepository ?? (_specialityRepository = new RepositoryGeneric <Speciality, int>(_context)));
 }
 public BussinesGeneric(IRepositoryGeneric <TEntity> repository)
 {
     _repository = repository;
 }
 public IRepositoryGeneric <Task, int> GetTaskRepository() //получение Task репозитория
 {
     return(_taskRepository ?? (_taskRepository = new TaskRepository(_context)));
 }
Esempio n. 10
0
 public IRepositoryGeneric <AppraisalFormReport, int> GetAppraisalFormReportRepository()
 {
     return(_appraisalFormReportRepository ??
            (_appraisalFormReportRepository = new RepositoryGeneric <AppraisalFormReport, int>(_context)));
 }
Esempio n. 11
0
 public IRepositoryGeneric <FormReport, int> GetFormReportRepository()
 {
     return(_formReportRepository ?? (_formReportRepository = new RepositoryGeneric <FormReport, int>(_context)));
 }
Esempio n. 12
0
 public IRepositoryGeneric <JournalProgress, int> GetJournalProgressRepository()
 {
     return(_journalProgressRepository ??
            (_journalProgressRepository = new RepositoryGeneric <JournalProgress, int>(_context)));
 }
Esempio n. 13
0
 public DeleteQuizHandler(IRepositoryGeneric <Quiz> repository)
 {
     _repository = repository;
 }
Esempio n. 14
0
 public UseCaseCrud(IRepositoryGeneric <T> reposGeneric)
 {
     _repoGeneric = reposGeneric;
 }
Esempio n. 15
0
 public BaseService(IRepositoryGeneric <TEntity> repository, IUnitOfWork unitOfWork, IValidator <TEntity> validator)
 {
     _repository = repository;
     _unitOfWork = unitOfWork;
     _validator  = validator;
 }
Esempio n. 16
0
 public GetQuizByIdHandler(IRepositoryGeneric <Quiz> repository)
 {
     _repository = repository;
 }
 public ServiceUserPost(IRepositoryGeneric <DtoUser> repository)
 {
     _repository = repository;
 }
 public CategoryService(IUnitOfWork unitOfWork, IRepositoryGeneric <Category> repository) : base(unitOfWork, repository)
 {
 }
 //получение Performer репозитория
 public IRepositoryGeneric<Performer, int> GetPerformerRepository()
 {
     return _performerRepository ?? (_performerRepository = new PerformerRepository(_context));
 }
Esempio n. 20
0
 public IRepositoryGeneric <JournalCurriculum, int> GetJournalCurriculumRepository()
 {
     return(_journalCurriculumRepository ??
            (_journalCurriculumRepository = new RepositoryGeneric <JournalCurriculum, int>(_context)));
 }
Esempio n. 21
0
 public IRepositoryGeneric <Progress, int> GetProgressRepository()
 {
     return(_progressRepository ?? (_progressRepository = new RepositoryGeneric <Progress, int>(_context)));
 }
Esempio n. 22
0
 public ServicoPrestadoService(IRepositoryGeneric repository,
                               IFiltroBuilderFactory filtroBuilderFactory)
 {
     _repository           = repository;
     _filtroBuilderFactory = filtroBuilderFactory;
 }
Esempio n. 23
0
 public IRepositoryGeneric <FormEducation, int> GetFormEducationRepository()
 {
     return(_formEducationRepository ??
            (_formEducationRepository = new RepositoryGeneric <FormEducation, int>(_context)));
 }
        private readonly IRepositoryGeneric <TEntity> _repositoryGeneric; //RepositoryGeneric içindeki hazır metotları

        public ServiceGeneric(IUnitOfWorks unitOfWorks, IRepositoryGeneric <TEntity> repositoryGeneric)
        {
            _unitOfWorks       = unitOfWorks;       //Database kaydı yapar.
            _repositoryGeneric = repositoryGeneric; //RepositoryGeneric içindeki hazır metotları çeker.
        }
Esempio n. 25
0
 public IRepositoryGeneric <Discipline, int> GetDisciplineRepository()
 {
     return(_disciplineRepository ?? (_disciplineRepository = new RepositoryGeneric <Discipline, int>(_context)));
 }
 public GenericService(IRepositoryGeneric repositoryGeneric, IMapper mapper)
 {
     _repositoryGeneric = repositoryGeneric;
     _mapper            = mapper;
 }
Esempio n. 27
0
 public IRepositoryGeneric <Student, int> GetStudentRepository()
 {
     return(_studetRepository ?? (_studetRepository = new RepositoryGeneric <Student, int>(_context)));
 }
Esempio n. 28
0
 public IRepositoryGeneric <Group, int> GetGroupRepository()
 {
     return(_groupRepository ?? (_groupRepository = new RepositoryGeneric <Group, int>(_context)));
 }
 public IRepositoryGeneric <Performer, int> GetPerformerRepository() //получение Performer репозитория
 {
     return(_performerRepository ?? (_performerRepository = new PerformerRepository(_context)));
 }
 //получение Task репозитория
 public IRepositoryGeneric<Task, int> GetTaskRepository()
 {
     return _taskRepository ?? (_taskRepository = new TaskRepository(_context));
 }
Esempio n. 31
0
 public DeleteResultHandler(IRepositoryGeneric <QuizResult> repository)
 {
     _repository = repository;
 }
Esempio n. 32
0
 //public GetAllUsersHandler(IMongoDatabase db, IQuizDatabaseSettings settings)
 public GetAllUsersHandler(IRepositoryGeneric <User> repository)
 {
     _repository = repository;
 }