Esempio n. 1
0
        public async Task <IHttpActionResult> PutTrainingValue(int id, TrainingValue trainingValue)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != trainingValue.ID)
            {
                return(BadRequest());
            }

            db.Entry(trainingValue).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TrainingValueExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 public void PostTrackerLocation(TrackerLocation loc)
 {
     db.TrackerLocations.Add(loc);
     db.SaveChangesAsync();
 }
Esempio n. 3
0
 public void PostKnn(Knn knn)
 {
     db.Knn.Add(knn);
     db.SaveChangesAsync();
 }