Ejemplo n.º 1
0
        public void Example()
        {
            var credential = new D365Credential("instanceName", "crm4", "username", "password");

            var engine = new SqlEngine(credential);

            var sql = @"
select top 5 c.firstname, lastname 'Last Name', emailaddress1 Email 
from contact as c 
where emailaddress1 is not null and firstname = 'abc' and emailaddress1 like'*****@*****.**'
order by c.firstname asc, lastname desc";

            var dsResults = engine.Execute(sql);

            Assert.IsNotNull(dsResults);
        }
Ejemplo n.º 2
0
        public static OrganizationService Create(D365Credential credential)
        {
            var uri = new Uri($"https://{credential.InstanceName}.api.{credential.InstanceRegion}.dynamics.com/XRMServices/2011/Organization.svc");

            var credentials = new ClientCredentials()
            {
                UserName =
                {
                    UserName = credential.Username,
                    Password = credential.Password,
                }
            };

            var instance = new OrganizationService(uri, credentials);

            return(instance);
        }