示例#1
0
 public List <CrmObject.Account> GetAllAccounts()
 {
     using (var ctx = new XRMContext(_crmService))
     {
         return((from act in ctx.AccountSet
                 select act).ToList());
     }
 }
示例#2
0
        public List <CrmObject.Account> GetChildAccountsForAnAccount(EntityReference parentAccount)
        {
            if (parentAccount == null)
            {
                throw new ArgumentNullException(nameof(parentAccount));
            }

            using (var ctx = new XRMContext(_crmService))
            {
                return((from act in ctx.AccountSet
                        where act.ParentAccountId.Id == parentAccount.Id
                        select act).ToList());
            }
        }