Ejemplo n.º 1
0
 protected override RequestResponse HandleDELETE(string requestPath)
 {
     RequestResponse response = new RequestResponse();
     try
     {
         bool deleted = new DeleteResolver().DeleteEntity(requestPath.Trim('/').TrimEnd('/'));
         response.ReturnCode = deleted ? 204 : 202;
     }
     catch(InvalidOperationException e)
     {
         response.ReturnCode = 501;
         response.SetResponseBuffer("An error occurred when trying to delete an entity: "
             + e.Message);
     }
     return response;
 }
Ejemplo n.º 2
0
        protected override RequestResponse HandleDELETE(string requestPath)
        {
            RequestResponse response = new RequestResponse();

            try
            {
                bool deleted = new DeleteResolver().DeleteEntity(requestPath.Trim('/').TrimEnd('/'));
                response.ReturnCode = deleted ? 204 : 202;
            }
            catch (InvalidOperationException e)
            {
                response.ReturnCode = 501;
                response.SetResponseBuffer("An error occurred when trying to delete an entity: "
                                           + e.Message);
            }
            return(response);
        }