public IHttpActionResult UpdateVenue(Venue venue) { PenOCDataContext db = new PenOCDataContext(); tblVenue venueRecord = db.tblVenues.Single(v => v.idVenue == venue.id); venueRecord.strName = venue.name; db.SubmitChanges(); return Ok(venue); }
public IHttpActionResult InsertVenue(Venue venue) { PenOCDataContext db = new PenOCDataContext(); tblVenue venueRecord = new tblVenue { strName = venue.name, }; db.tblVenues.InsertOnSubmit(venueRecord); db.SubmitChanges(); venue.id = venueRecord.idVenue; return Ok(venue); }