示例#1
0
        public IHttpActionResult Operation([FromBody] OperationMessage operationMessage)
        {
            OperationConstructor constructor = new OperationConstructor(operationMessage);
            Operation            operation   = constructor.CreateOperation();

            OperationExecutor     executor     = OperationExecutor.GetInstance();
            EngineOperationResult engineResult = executor.ExecuteOperation(operation);

            if (engineResult.isSuccessful())
            {
                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }
示例#2
0
        public IHttpActionResult Operation([FromBody] OperationMessage operationMessage)
        {
            if (operationMessage != null && operationMessage.isValid())
            {
                OperationConstructor constructor = new OperationConstructor(operationMessage);
                Operation            operation   = constructor.CreateOperation();
                OperationExecutor    executor    = OperationExecutor.GetInstance();

                EngineOperationResult engineResult = executor.ExecuteOperation(operation);

                if (engineResult.isSuccessful())
                {
                    return(Ok());
                }
                else
                {
                    return(BadRequest("Bad operation"));
                }
            }
            else
            {
                return(BadRequest("Wrong Json Format"));
            }
        }