public void InitialiseApi() { var eventsHook = new Hook <object>(); _context.Hooks.Add(eventsHook); var commandsHook = new Hook <Abstractions.Commands.ICommand>(); _context.Hooks.Add(commandsHook); var webApi = new TestWebApi(_context, eventsHook, commandsHook); var options = new WebApplicationFactoryClientOptions { BaseAddress = new System.Uri($"https://localhost:{GetAvailablePort(5001)}") }; _context.EmployerIncentivesWebApiFactory = webApi; _context.EmployerIncentiveApi = new EmployerIncentiveApi(webApi.CreateClient(options)); }
// PUT: api/Values/5 public void Put(int id, TestWebApi _entity) { db.Update(_entity); }
// POST: api/Values public void Post(TestWebApi _entity) { db.Create(_entity); }