Skip to content

Instantly share code, notes, and snippets.

@tswann
Created September 21, 2011 12:38
Show Gist options
  • Save tswann/1231927 to your computer and use it in GitHub Desktop.
Save tswann/1231927 to your computer and use it in GitHub Desktop.
Retrieve a CRM Contact using LINQ, update and save it back to Dynamics.
IList<Contact> testers = _context.ContactSet.Where(x => x.LastName == "McTesterson").ToList();
Contact tester = testers[0];
tester.FirstName = "Pete";
_context.UpdateObject(tester);
_context.SaveChanges();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment