public UsersController(
     CarManagerDbContext dbContext,
     IMapper mapper,
     UserManager <User> userManager)
 {
     this.dbContext   = dbContext;
     this.mapper      = mapper;
     this.userManager = userManager;
 }
        protected override void Seed(CarManagerDbContext context)
        {
            var states = new List <State>();

            states.Add(new State {
                Name = "VePo"
            });
            states.Add(new State {
                Name = "Regio"
            });

            context.States.AddRange(states);

            context.SaveChanges();
        }
Exemple #3
0
        public void Index_View()
        {
            //Arrange
            var options = new DbContextOptionsBuilder <CarManagerDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var dbContext = new CarManagerDbContext(options);

            AutoMapper.Mapper.Initialize(config => config.AddProfile <AutoMapperProfile>());
            var controller = new HomeController(dbContext, AutoMapper.Mapper.Instance);

            //Act
            var result = controller.Index();

            //Assert
            Assert.IsInstanceOfType(result, typeof(ViewResult));
        }
Exemple #4
0
 public StateRepository(CarManagerDbContext databaseContext) : base(databaseContext)
 {
 }
Exemple #5
0
 public CarController(CarManagerDbContext dbContext, UserManager <AppUser> userManager)
 {
     this._dbContext   = dbContext;
     this._userManager = userManager;
 }
Exemple #6
0
 public CarApiController(CarManagerDbContext dbContext)
 {
     this._dbContext = dbContext;
 }
 public DeleteModel(CarManagerDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
Exemple #8
0
 public AddTaxModel(CarManagerDbContext context)
 {
     this.context = context;
 }
Exemple #9
0
 public LoggedUserVehiclesService(CarManagerDbContext dbContext, IMapper mapper)
     : base(dbContext, mapper)
 {
 }
Exemple #10
0
 public PlanningRepository(CarManagerDbContext databaseContext) : base(databaseContext)
 {
 }
 // Constructor
 public GenericRepository(CarManagerDbContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
 public AddRefuelingModel(CarManagerDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
 public HomeController(CarManagerDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
 public BaseEFService(CarManagerDbContext dbContext, IMapper mapper)
 {
     this.DbContext = dbContext;
     this.Mapper    = mapper;
 }
 public AddServiceInfoModel(CarManagerDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }