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()); } }
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")); } }