public async Task <IActionResult> DeleteAsync(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest());
            }

            DependentDomainModel deleted = null;

            try { deleted = await _domain.DeleteAsync(id).ConfigureAwait(false); }
            catch (Exception ex) { return(BadRequest(ex.InnerException)); }

            return(Ok(deleted));
        }
Esempio n. 2
0
        public void DeleteAsync_WithNullDependentParameter_ReturnArgumentNullException()
        {
            Func <Task> act = () => _domain.DeleteAsync(Guid.Empty);

            act.Should().Throw <ArgumentNullException>();
        }