Skip to content

Instantly share code, notes, and snippets.

@pawelgradecki
Created November 28, 2018 07:56
Embed
What would you like to do?
var crmClient = new CrmServiceClient(ConfigurationManager.ConnectionStrings["D365"].ConnectionString);
if (crmClient.IsReady)
{
using (var ctx = new OrganizationServiceContext(crmClient))
{
var result = ctx.CreateQuery<Contact>()
.Where(a => a.FirstName == "Jan")
.Select(a => new Contact
{
Id = a.Id,
FirstName = a.FirstName
})
.ToList();
Console.WriteLine(result.Count);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment