Example #1
0
        public async Task <IActionResult> Delete([FromRoute] long id)
        {
            var catalog  = new ItemCatalog(_dbContext, _messageBroker);
            var tenantId = User.Claims.TenantId();

            await catalog.Find(tenantId, id);

            if (catalog.ItemNotExists)
            {
                return(new ItemNotFoundError());
            }

            await catalog.Delete();

            return(NoContent());
        }