// POST api/<controller> public void PostLocation(Location location) { try { string connectionString = Properties.Settings.Default.FreeFootieConnectionString; using (FreeFootieDataContext myData = new FreeFootieDataContext(connectionString)) { using (TransactionScope myScope = new TransactionScope()) { location newLocation = new location(); var newID = (from c in myData.locations select c.id).Max(); newLocation.id = newID + 1; newLocation.name = location.name; newLocation.latitude = location.latitude; newLocation.longitude = location.longitude; myData.locations.InsertOnSubmit(newLocation); myData.SubmitChanges(); myScope.Complete(); } } } catch (Exception ex) { Common.ErrorCatch(ex, "LocationController.PostLocation"); } }
partial void Updatelocation(location instance);
partial void Deletelocation(location instance);
partial void Insertlocation(location instance);