public UnitOfWork(IApplicationDbContext context, ICigarRepository cigarRepository) //ICountryRepository countryRepository, //IInventoryItemRepository inventoryItemRepository) { this.context = context; CigarRepository = cigarRepository; //InventoryItemRepository = inventoryItemRepository; //CountryRepository = countryRepository; }
public CigarRepositoryTests() { var data = new List <Cigar> { new Cigar { Id = 1, Name = "Test1", Country = "Finland" }, new Cigar { Id = 2, Name = "Test2", Country = "Germany" }, new Cigar { Id = 3, Name = "Temp4", Country = "France" }, new Cigar { Id = 4, Name = "Temp3", Country = "Finland" } }.AsQueryable(); var mockDbSet = DbContextHelpers.CreateMockDbSet(data); var mockContext = DbContextHelpers.CreateMockDbContext(mockDbSet.Object); cigarRepository = new CigarRepository(mockContext.Object); }
public CigarController(ICigarRepository repo) =>
public ManufacturerController(ICigarRepository repo) =>
/// <summary> /// Creates a new instance of the <see cref="AddCigarCommandHandler" /> /// class. /// </summary> /// <param name="cigarRepository"> /// Required type used to persist the new cigar. /// </param> public AddCigarCommandHandler(ICigarRepository cigarRepository) { _cigarRepository = cigarRepository; }