Пример #1
0
        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());
        }
Пример #2
0
 public IActionResult Update([FromBody] Marker m)
 {
     ctx.Markers.Attach(m);
     ctx.Entry(m).State = EntityState.Modified;
     return(Ok());
 }