public async Task <IActionResult> Create( [FromServices] IMapper mapper, [FromServices] ILaanFacade facade, [FromBody] LaanRequest request) { var entity = mapper.Map <LaanEntity>(request); await facade.CreateAsync(entity); return(Created(string.Empty, "Lån er oprettet")); }
public async Task <IActionResult> Delete([FromServices] ILaanFacade facade, string rowKey) { try { await facade.DeleteAsync(rowKey); return(Ok()); } catch (RequestFailedException exception) { if (exception.Status == 404) { return(NotFound()); } throw; } }
public async Task <IActionResult> GetByRowKey([FromServices] ILaanFacade facade, string rowKey) { var response = await facade.GetByRowKeyAsync(rowKey); return(Ok(response)); }
public IActionResult GetByBoligKey([FromServices] ILaanFacade facade, string boligKey) { var response = facade.GetByBoligKeyAsync(boligKey); return(Ok(response)); }