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