Final, we reach the end of the CRUD, delete. Delete is very identical to update. We only need to change one line of Migrate / Move from Entity Framework (EF) to WCF Data Services (Part 3) – Update code to.
So the code in Main function will look as below.
static void Main(string args)
//Define an entity object
BCServiceReference.BeancurdEntities entBC = new BCServiceReference.BeancurdEntities(new Uri("http://localhost:7318/BCDataService.svc/"));
//define a single Beancurds object
BCServiceReference.Beancurds objBC = new BCServiceReference.Beancurds();
//Retrieve id with value = 1
objBC = (from bean in entBC.Beancurds where bean.BeancurdID == 1 select bean).First();
objBC.BeancurdType = "UK";
//Update to database