public void Init() { this.ConfigureMapper(); this.cars = new List <Car>() { new Car() { Id = 1, Price = 20, Name = "Volga" }, new Car() { Id = 2, Price = 30, Name = "Chaika" } }; this._context = new FakeCarsDbContext(); foreach (var car in cars) { this._context.Cars.Add(car); } HttpConfiguration config = new HttpConfiguration(); this._service = new CarsService(this._context); this._controller = new CarsController(this._service); this._controller.Configuration = config; }
public UnitOfWork(ICarsDbContext dbContext) { if (dbContext == null) { throw new ArgumentNullException("Db context cannot be null"); } this.dbContext = dbContext; }
public Repository(ICarsDbContext dbContext) { if (dbContext == null) { throw new ArgumentNullException("Db context cannot be null."); } this.dbContext = dbContext; }
public Service(ICarsDbContext context) { this.Context = context; }
public QueryXmlParser(ICarsDbContext carsContext) { this.carsContext = carsContext; }
public DataJsonImporter(ICarsDbContext carsContext) { this._carsContext = carsContext; }
public CarsService(ICarsDbContext cars) : base(cars) { }