public IActionResult Post([FromBody] Marker m) { if (m.id == 0) { ctx.Markers.Add(m); } else { ctx.Markers.Attach(m); ctx.Entry(m).State = EntityState.Modified; } ctx.SaveChanges(); BroadcastMarkers(); return(Ok()); }
public IActionResult Update([FromBody] Marker m) { ctx.Markers.Attach(m); ctx.Entry(m).State = EntityState.Modified; return(Ok()); }