Beispiel #1
0
        public async Task <JsonResult> Delete(long id)
        {
            var entityDto = new EntityDto <int> {
                Id = (int)id
            };
            await _tenantAppService.Delete(entityDto);

            return(Json(entityDto));
        }
Beispiel #2
0
        public async Task <IActionResult> DeleteTenant(long id)
        {
            try
            {
                await _tenantAppService.Delete(id);

                return(Ok("Deleted tenant"));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
        public async Task <IActionResult> Delete(int id)
        {
            TenantDto tenant = await _tenantAppService.GetById(id);

            if (tenant == null)
            {
                return(NotFound("Tenant not found."));
            }

            try
            {
                await _tenantAppService.Delete(id);

                return(Ok("Tenant deleted successfully."));
            }
            catch (Exception ex)
            {
                return(Conflict("Error deleting the Tenant. " + ex.Message));
            }
        }