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);
 }
Пример #2
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
        }