private int FetchTotalFromESFor(DiagnosisQuery query) { // don't hard-code this URL. Access via entry point resource var projectionStateUrl = "http://localhost:2113/projection/DiagnosesByMonthCounts/state"; var streamname = "diagnosis-" + query.DiagnosisId + "_" + query.Month.ToString("yyyyMM"); // may want to use caching here var response = new WebClient().DownloadString(projectionStateUrl + "?partition=" + streamname); var count = Json.Decode <DiagnosisCount>(response); return(count == null ? 0 : count.Count); }
private int FetchTotalFromESFor(DiagnosisQuery query) { // don't hard-code this URL. Access via entry point resource var projectionStateUrl = "http://localhost:2113/projection/DiagnosesByMonthCounts/state"; var streamname = "diagnosis-" + query.DiagnosisId + "_" + query.Month.ToString("yyyyMM"); // may want to use caching here var response = new WebClient().DownloadString(projectionStateUrl + "?partition=" + streamname); var count = Json.Decode<DiagnosisCount>(response); return count == null ? 0 : count.Count; }