public OperationResult Calculate(OperationRequest request) { try { var result = _service.Calculate(request); return(result); } catch (Exception ex) { throw new HttpResponseException(HttpStatusCode.BadRequest); } }
public IHttpActionResult PostSum([FromUri] string sum) { try { var log = new Log(FindIPAddress()); _logService.Add(log); var result = _calcService.Calculate(sum); return(Ok(result)); } catch (Exception) { return(BadRequest("Error In Calculation")); } }
public async Task HandleAsync(IMessage message) { var batchTelemetry = message as BatchTelemetry; if (batchTelemetry != null) { var aggregations = await calcService.Calculate(batchTelemetry); foreach (var calcData in aggregations) { // todo: bulk publish? eventBus.Publish(EventTopic.CalcData, calcData); } } }
public void Calculate(double[] values, double value, string operation) { _service.Calculate(values, value, operation); _service.ConvertToString(); }