public async Task Should_Throw_Exception_With_Wrong_Id() { var id = Guid.NewGuid(); var e = await Assert.ThrowsAsync <EntityNotFoundException>(async() => await _clientAppService.GetAsync(id)); e.EntityType.ShouldBe(typeof(Client)); e = await Assert.ThrowsAsync <EntityNotFoundException>(async() => await _clientAppService.DeleteAsync(id)); e.EntityType.ShouldBe(typeof(Client)); }
public async Task <IActionResult> Delete([FromRoute] int id) { try { await _clientAppService .DeleteAsync(id) .ConfigureAwait(false); return(Ok()); } catch (Exception ex) { return(NotFound(ex.Message)); } }
public virtual Task DeleteAsync(Guid id) { return(_clientAppService.DeleteAsync(id)); }