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));
        }
예제 #2
0
        public async Task <IActionResult> Delete([FromRoute] int id)
        {
            try
            {
                await _clientAppService
                .DeleteAsync(id)
                .ConfigureAwait(false);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(NotFound(ex.Message));
            }
        }
예제 #3
0
 public virtual Task DeleteAsync(Guid id)
 {
     return(_clientAppService.DeleteAsync(id));
 }