Ejemplo n.º 1
0
        public virtual Task <IAppTestDrive> Create()
        {
            var crmService = StartupHelper.CreateCrmService();
            ITestDriveRepository repository = new TestDriveRepository();
            ITestDriveService    service    = new TestDriveService(crmService, repository);
            IAppTestDrive        app        = new AppTestDrive(service);

            return(Task.FromResult(app));
        }
        protected ITestDriveService GetService(ApplicationDbContext dbContext, UserManager <User> userManager)
        {
            var testDriveRepository = new TestDriveRepository(dbContext);
            var statusRepository    = new StatusRepository(dbContext);
            var carRepository       = new CarRepository(dbContext);
            var servie = new TestDriveService(testDriveRepository, statusRepository, carRepository, userManager);

            return(servie);
        }
        protected IAdminDashboardStatisticsService GetService(ApplicationDbContext dbContext)
        {
            var testDriveRepository = new TestDriveRepository(dbContext);
            var userRepository      = new UserRepository(dbContext);
            var roleRepository      = new RoleRepository(dbContext);

            this.SeedAllRoles(dbContext);
            var carRepository = new CarRepository(dbContext);
            var service       = new AdminDashboardStatisticsService(testDriveRepository, userRepository, roleRepository, carRepository);

            return(service);
        }
Ejemplo n.º 4
0
        protected IAdminTestDrivesService GetService(ApplicationDbContext dbContext)
        {
            var testDriveRepository = new TestDriveRepository(dbContext);
            var statusRepository    = new StatusRepository(dbContext);

            this.UpcomingStatus = SeedStatusesMethods.SeedStatus(dbContext, TestDriveStatus.Upcoming);
            this.PassedStatus   = SeedStatusesMethods.SeedStatus(dbContext, TestDriveStatus.Passed);
            var adminDeleteService = new AdminCommonDeleteService(dbContext);
            var service            = new AdminTestDrivesService(testDriveRepository, statusRepository, adminDeleteService);

            return(service);
        }