Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
var session = serviceFactory.GetSessionFromConnectionString("MyDynamicsInstance");
// Find a lead by email address.
var lead = await GenericEntity.LoadSingleAsync(session, "lead",
  (query, x) =>
  {
    query.Filter("emailaddress1 eq 'example@example.com'").selectSelect("firstname, lastname");
  }
);
// Returned objects support Dictionary syntax to access fields.
Console.WriteLine($"First name: {lead["firstname"]}, Last name: {lead["lastname"]}");

...