public IActionResult UpdateFuel([FromBody] Fuel uFuel) { var oFuel = context.Fuels.Find(uFuel.Id); if (oFuel == null) { return(NotFound()); } oFuel.Name = uFuel.Name; oFuel.Capacity = uFuel.Capacity; context.SaveChanges(); return(Ok(oFuel)); }
public IActionResult CreatePlan([FromBody] Plan newPlan) { context.Plans.Add(newPlan); context.SaveChanges(); return(Created("", newPlan)); }