예제 #1
0
 public UnitOfWork(DataContext dataContext)
 {
     _dataContext               = dataContext;
     CaseRepository             = new CaseRepository(_dataContext);
     ChipsetRepository          = new ChipsetRepository(_dataContext);
     CoreSeriesRepository       = new CoreSeriesRepository(_dataContext);
     CoreSpeedRepository        = new CoreSpeedRepository(_dataContext);
     CPURepository              = new CPURepository(_dataContext);
     CPUCoolerRepository        = new CPUCoolerRepository(_dataContext);
     EfficiencyRatingRepository = new EfficiencyRatingRepository(_dataContext);
     FormFactorRepository       = new FormFactorRepository(_dataContext);
     InterfaceRepository        = new InterfaceRepository(_dataContext);
     ManufacturerRepository     = new ManufacturerRepository(_dataContext);
     MemorySpeedRepository      = new MemorySpeedRepository(_dataContext);
     MemoryTypeRepository       = new MemoryTypeRepository(_dataContext);
     ModuleRepository           = new ModuleRepository(_dataContext);
     MotherboardRepository      = new MotherboardRepository(_dataContext);
     NumbersRepository          = new NumbersRepository(_dataContext);
     PowerSupplyRepository      = new PowerSupplyRepository(_dataContext);
     ProtocolRepository         = new ProtocolRepository(_dataContext);
     RAMRepository              = new RAMRepository(_dataContext);
     SocketRepository           = new SocketRepository(_dataContext);
     StorageRepository          = new StorageRepository(_dataContext);
     StorageTypeRepository      = new StorageTypeRepository(_dataContext);
     VideoCardRepository        = new VideoCardRepository(_dataContext);
     WirelessAdapterRepository  = new WirelessAdapterRepository(_dataContext);
 }
 public UnitOfWork(ApplicationDataBaseContext applicationDataBaseContext)
 {
     _applicationDataBaseContext = applicationDataBaseContext;
     Computers            = new ComputerRepository(_applicationDataBaseContext);
     ComputerSystems      = new ComputerSystemRepository(_applicationDataBaseContext);
     Processors           = new ProcessorRepository(_applicationDataBaseContext);
     PhysicalMemories     = new PhysicalMemoryRepository(_applicationDataBaseContext);
     DiskDrives           = new DiskDriveRepository(_applicationDataBaseContext);
     MotherBoards         = new MotherBoardRepository(_applicationDataBaseContext);
     VideoCards           = new VideoCardRepository(_applicationDataBaseContext);
     Processes            = new ProcessRepository(_applicationDataBaseContext);
     ProcessesInformation = new ProcessInformationRepository(_applicationDataBaseContext);
     ProcessesPerfomance  = new ProcessPerfomanceRepository(_applicationDataBaseContext);
 }
예제 #3
0
        public EFUnitOfWork(ApplicationContext db, Microsoft.Extensions.Options.IOptions <Microsoft.AspNetCore.Identity.IdentityOptions> optionAccessor, Microsoft.AspNetCore.Identity.IPasswordHasher <ApplicationUser> passwordHasher, IEnumerable <Microsoft.AspNetCore.Identity.IUserValidator <ApplicationUser> > userValidators, IEnumerable <Microsoft.AspNetCore.Identity.IPasswordValidator <ApplicationUser> > passwordValidators, Microsoft.AspNetCore.Identity.ILookupNormalizer keyNormalizer, Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors, IServiceProvider servises, Microsoft.Extensions.Logging.ILogger <Microsoft.AspNetCore.Identity.UserManager <ApplicationUser> > logger, IEnumerable <Microsoft.AspNetCore.Identity.IRoleValidator <ApplicationRole> > roleValidators, Microsoft.Extensions.Logging.ILogger <Microsoft.AspNetCore.Identity.RoleManager <ApplicationRole> > roleLogger)
        {
            this.db = db;

            #region User repositories

            ApplicationUsers      = new ApplicationUserManager(new UserStore <ApplicationUser>(db), optionAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, servises, logger);
            Roles                 = new ApplicationRoleManager(new RoleStore <ApplicationRole>(db), roleValidators, keyNormalizer, errors, roleLogger);
            UserProfiles          = new UserProfileRepository(db);
            Comments              = new CommentRepository(db);
            ComputerAssemblyRates = new ComputerAssemblyRateRepository(db);

            #endregion

            #region Infrastructure repositories

            ComputerAssemblies = new ComputerAssemblyRepository(db);
            Manufacturers      = new ManufacturerRepository(db);
            Softwares          = new SoftwareRepository(db);
            Developers         = new DeveloperRepository(db);
            Publishers         = new PublisherRepository(db);
            Countries          = new CountryRepository(db);

            #endregion

            #region Specification repositories

            CPUSockets                       = new CPUSocketRepository(db);
            GPUs                             = new GPURepository(db);
            GraphicMemoryTypes               = new GraphicMemoryTypeRepository(db);
            MotherBoardFormFactors           = new MotherBoardFormFactorRepository(db);
            MotherBoardNorthBridges          = new MotherBoardNorthBridgeRepository(db);
            OuterMemoryFormFactors           = new OuterMemoryFormFactorRepository(db);
            OuterMemoryInterfaces            = new OuterMemoryInterfaceRepository(db);
            PowerSupplyCPUInterfaces         = new PowerSupplyCPUInterfaceRepository(db);
            PowerSupplyMotherBoardInterfaces = new PowerSupplyMotherBoardInterfaceRepository(db);
            RAMTypes                         = new RAMTypeRepository(db);
            RequirementTypes                 = new RequirementTypeRepository(db);
            VideoCardInterfaces              = new VideoCardInterfaceRepository(db);
            #endregion

            #region Joins repositories

            ComputerAssemblyHDDs                = new ComputerAssemblyHDDRepository(db);
            ComputerAssemblyRAMs                = new ComputerAssemblyRAMRepository(db);
            ComputerAssemblySSDs                = new ComputerAssemblySSDRepository(db);
            ComputerAssemblyVideoCards          = new ComputerAssemblyVideoCardRepository(db);
            MotherBoardOuterMemorySlots         = new MotherBoardOuterMemorySlotRepository(db);
            MotherBoardRAMSlots                 = new MotherBoardRAMSlotRepository(db);
            MotherBoardPowerSupplySlots         = new MotherBoardPowerSupplySlotRepository(db);
            MotherBoardVideoCardSlots           = new MotherBoardVideoCardSlotRepository(db);
            PCCaseMotherBoardFormFactors        = new PCCaseMotherBoardFormFactorRepository(db);
            PCCaseOuterMemoryFormFactors        = new PCCaseOuterMemoryFormFactorRepository(db);
            PowerSupplyPowerSupplyCPUInterfaces = new PowerSupplyPowerSupplyCPUInterfaceRepository(db);
            SoftwareCPURequirements             = new SoftwareCPURequirementRepository(db);
            SoftwareVideoCardRequirements       = new SoftwareVideoCardRequirementRepository(db);
            #endregion

            #region Hardware Repositories

            CPUs          = new CPURepository(db);
            HDDs          = new HDDRepository(db);
            MotherBoards  = new MotherBoardRepository(db);
            PCCases       = new PCCaseRepository(db);
            PowerSupplies = new PowerSupplyRepository(db);
            RAMs          = new RAMRepository(db);
            SSDs          = new SSDRepository(db);
            VideoCards    = new VideoCardRepository(db);

            #endregion
        }