public SampleAPIController(SampleAPIContext context) { _context = context; if (_context.customer.Count() == 0) { _context.customer.Add(new Customer { customerPk = 1 }); _context.SaveChanges(); } }
public TestHandler(SampleAPIContext dbContext, IHttpContextAccessor httpContextAccessor) { _dbContext = dbContext; _httpContextAccessor = httpContextAccessor; }