コード例 #1
0
        public IActionResult Delete(string id)
        {
            long ID = 0;

            if (long.TryParse(id, out ID))
            {
                Organization org = _srv.GetOrg(ID);
                if (org != null)
                {
                    if (_srv.DeleteOrg(org))
                    {
                        return(Ok());
                    }
                    return(BadRequest("Deleting organization failed!"));
                }
                return(NotFound($"Couldn't find organization with ID: {ID}!"));
            }
            return(BadRequest("Couldn't parse organization ID!"));
        }