public void Setup() { db = SetDatabaseContext(); _mapper = SetAutomapper(); operatorCityService = new OperatorCityService(_mapper, db); Seed(db); }
public void Setup() { if (mapper == null) { var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new AutomapperProfile()); }); IMapper mapper = mappingConfig.CreateMapper(); this.mapper = mapper; } var dbContextOptions = new DbContextOptionsBuilder <DatabaseContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; db = new DatabaseContext(dbContextOptions); operatorCityService = new OperatorCityService(mapper, db); operatorCityController = new OperatorCityController(operatorCityService); Seed(db); }
public OperatorCityController(OperatorCityService operatorCityService) { OperatorCityService = operatorCityService; }