public ActionResult <OperationResponseModel> Multiplication( [FromBody] BasicOperationRequestModel basicOperationRequestModel) => new OperationResponseModel { Result = basicOperationRequestModel.Number1 * basicOperationRequestModel.Number2, OperationRequestedBy = GetUserNameFromContext() };
public ActionResult <OperationResponseModel> Division([FromBody] BasicOperationRequestModel basicOperationRequestModel) { if (basicOperationRequestModel.Number2 == 0) { return(BadRequest("Division by zero")); } return(new OperationResponseModel { Result = basicOperationRequestModel.Number1 / basicOperationRequestModel.Number2, OperationRequestedBy = GetUserNameFromContext() }); }