public AuthService(IRepositoryAuth repositoryAuth, IRepositoryGeneric repositoryGeneric, IConfiguration configuration, IMapper mapper) { _repositoryAuth = repositoryAuth; _repositoryGeneric = repositoryGeneric; _configuration = configuration; _mapper = mapper; }
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()); } } }
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; }
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; }
public IRepositoryGeneric <Curriculum, int> GetCurriculumRepository() { return(_curriculumRepository ?? (_curriculumRepository = new RepositoryGeneric <Curriculum, int>(_context))); }
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))); }
public IRepositoryGeneric <AppraisalFormReport, int> GetAppraisalFormReportRepository() { return(_appraisalFormReportRepository ?? (_appraisalFormReportRepository = new RepositoryGeneric <AppraisalFormReport, int>(_context))); }
public IRepositoryGeneric <FormReport, int> GetFormReportRepository() { return(_formReportRepository ?? (_formReportRepository = new RepositoryGeneric <FormReport, int>(_context))); }
public IRepositoryGeneric <JournalProgress, int> GetJournalProgressRepository() { return(_journalProgressRepository ?? (_journalProgressRepository = new RepositoryGeneric <JournalProgress, int>(_context))); }
public DeleteQuizHandler(IRepositoryGeneric <Quiz> repository) { _repository = repository; }
public UseCaseCrud(IRepositoryGeneric <T> reposGeneric) { _repoGeneric = reposGeneric; }
public BaseService(IRepositoryGeneric <TEntity> repository, IUnitOfWork unitOfWork, IValidator <TEntity> validator) { _repository = repository; _unitOfWork = unitOfWork; _validator = validator; }
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)); }
public IRepositoryGeneric <JournalCurriculum, int> GetJournalCurriculumRepository() { return(_journalCurriculumRepository ?? (_journalCurriculumRepository = new RepositoryGeneric <JournalCurriculum, int>(_context))); }
public IRepositoryGeneric <Progress, int> GetProgressRepository() { return(_progressRepository ?? (_progressRepository = new RepositoryGeneric <Progress, int>(_context))); }
public ServicoPrestadoService(IRepositoryGeneric repository, IFiltroBuilderFactory filtroBuilderFactory) { _repository = repository; _filtroBuilderFactory = filtroBuilderFactory; }
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. }
public IRepositoryGeneric <Discipline, int> GetDisciplineRepository() { return(_disciplineRepository ?? (_disciplineRepository = new RepositoryGeneric <Discipline, int>(_context))); }
public GenericService(IRepositoryGeneric repositoryGeneric, IMapper mapper) { _repositoryGeneric = repositoryGeneric; _mapper = mapper; }
public IRepositoryGeneric <Student, int> GetStudentRepository() { return(_studetRepository ?? (_studetRepository = new RepositoryGeneric <Student, int>(_context))); }
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)); }
public DeleteResultHandler(IRepositoryGeneric <QuizResult> repository) { _repository = repository; }
//public GetAllUsersHandler(IMongoDatabase db, IQuizDatabaseSettings settings) public GetAllUsersHandler(IRepositoryGeneric <User> repository) { _repository = repository; }