...
Code Block | ||
---|---|---|
| ||
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"]}"); |
...