WhiskWork.Web.WorkflowHttpResponse.Forbidden C# (CSharp) Method

Forbidden() public static method

public static Forbidden ( Exception e ) : WorkflowHttpResponse
e System.Exception
return WorkflowHttpResponse
        public static WorkflowHttpResponse Forbidden(Exception e)
        {
            var response = new WorkflowHttpResponse(HttpStatusCode.Forbidden);
            response.Write(e.Message);
            return response;
        }

Usage Example

Exemplo n.º 1
0
        private WorkflowHttpResponse DeleteWorkItem(string path, string id)
        {
            if (!_workflow.ExistsWorkItem(id))
            {
                return(WorkflowHttpResponse.NotFound);
            }

            var wi = _workflow.GetWorkItem(id);

            if (wi.Path != path)
            {
                return(WorkflowHttpResponse.NotFound);
            }

            try
            {
                _workflow.DeleteWorkItem(id);
            }
            catch (Exception e)
            {
                return(WorkflowHttpResponse.Forbidden(e));
            }

            return(WorkflowHttpResponse.Ok);
        }
All Usage Examples Of WhiskWork.Web.WorkflowHttpResponse::Forbidden