public JsonResult Post([FromBody] Site site) { if (site != null) { if (ModelState.IsValid) { _dbContext.Entry(site).State = EntityState.Added; _dbContext.SaveChanges(); return(Json(site)); } } return(Json("Not saved")); }
public void Post([FromBody] FluidInfusion fluidInfusion) { if (ModelState.IsValid) { _dbContext.FluidInfusions.Add(fluidInfusion); _dbContext.SaveChanges(); } }
public void Post([FromBody] Subject subject) { if (ModelState.IsValid) { _dbContext.Subjects.Add(subject); _dbContext.SaveChanges(); } }
public void Post([FromBody] DextroseConcentration dexCon) { if (ModelState.IsValid) { _dbContext.DextroseConcentrations.Add(dexCon); _dbContext.SaveChanges(); } }
public JsonResult Post([FromBody] Models.CalEntry entry) { if (entry != null) { if (ModelState.IsValid) { _dbContext.Entry(entry).State = EntityState.Added; _dbContext.SaveChanges(); return(Json(entry)); } } return(Json("Not saved")); }