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();
        }
示例#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));
        }
示例#4
0
 public StateRepository(CarManagerDbContext databaseContext) : base(databaseContext)
 {
 }
示例#5
0
 public CarController(CarManagerDbContext dbContext, UserManager <AppUser> userManager)
 {
     this._dbContext   = dbContext;
     this._userManager = userManager;
 }
示例#6
0
 public CarApiController(CarManagerDbContext dbContext)
 {
     this._dbContext = dbContext;
 }
 public DeleteModel(CarManagerDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
示例#8
0
 public AddTaxModel(CarManagerDbContext context)
 {
     this.context = context;
 }
示例#9
0
 public LoggedUserVehiclesService(CarManagerDbContext dbContext, IMapper mapper)
     : base(dbContext, mapper)
 {
 }
示例#10
0
 public PlanningRepository(CarManagerDbContext databaseContext) : base(databaseContext)
 {
 }
示例#11
0
 // 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;
 }