public HttpResponseMessage PostTrackerReadingModel(TrackerReadingModel trackerReadingModel) { TrackerReadingRepository repo = new TrackerReadingRepository(); bool ok = repo.AddReading(trackerReadingModel); if(ok) return Request.CreateResponse(HttpStatusCode.OK); else { return Request.CreateResponse(HttpStatusCode.BadRequest); } }
public HttpResponseMessage PostMultiTrackerReadings(List<TrackerReadingModel> trackerReadingModels) { TrackerReadingRepository repo = new TrackerReadingRepository(); var ok = repo.AddReadings(trackerReadingModels); if (ok) { return Request.CreateResponse(HttpStatusCode.OK); } else { return Request.CreateResponse(HttpStatusCode.BadRequest); } }