public IHttpActionResult PutPinLocation(short lid, PinLocation pinLocation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (lid != pinLocation.PinId) { return(BadRequest()); } db.Entry(pinLocation).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PinLocationExists(lid)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public PinGroup(IGraphBlock block, string id, PinLocation location, string caption) { Block = block; Id = id; Location = location; Caption = caption; }
public PinGroup(IGraphBlock block, string id, PinLocation location, string caption) { Block = block; Id = id; Location = location; Caption = caption; H <PinGroup> .Initialize(this); }
public void Inject(IGraphBlock block, string id, PinLocation location, string caption) { H <PinGroup> .Initialize(this); Block = block; Id = id; Location = location; Caption = caption; }
public IHttpActionResult PostPinLocation(PinLocation pinLocation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PinLocation.Add(pinLocation); db.SaveChanges(); return(Ok(pinLocation.PinId)); //return CreatedAtRoute("DefaultApi", new { id = pinLocation.PinId }, pinLocation); }
public IHttpActionResult DeletePinLocation(short lid) { PinLocation pinLocation = db.PinLocation.Find(lid); if (pinLocation == null) { return(NotFound()); } db.PinLocation.Remove(pinLocation); db.SaveChanges(); return(Ok(pinLocation)); }
public IPinGroup GetOrAddGroup(string id, PinLocation location, string caption = "") { // TODO : new to Ioc return(Groups.GetOrAdd(g => g.Id == id, () => _getPinGroup(this, id, location, caption))); }