コード例 #1
0
        public IEnumerable <AsycudaDocumentSetEx> GetAsycudaDocumentSetExsByExpression(string exp, Dictionary <string, string> navExp)
        {
            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new List <AsycudaDocumentSetEx>().AsEnumerable());
            }
            using (var t = new AsycudaDocumentSetExClient())
            {
                IEnumerable <DTO.AsycudaDocumentSetEx> res = null;
                if (exp == "All" && navExp.Count == 0)
                {
                    res = t.GetAsycudaDocumentSetExs().Result;
                }
                else
                {
                    res = t.GetAsycudaDocumentSetExsByExpressionNav(exp, navExp).Result;
                }

                if (res != null)
                {
                    return(res.Select(x => new AsycudaDocumentSetEx(x)).AsEnumerable());
                }
                else
                {
                    return(null);
                }
            }
        }
コード例 #2
0
        public async Task <IEnumerable <AsycudaDocumentSetEx> > GetAsycudaDocumentSetExsByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new List <AsycudaDocumentSetEx>().AsEnumerable());
            }
            try
            {
                using (var t = new AsycudaDocumentSetExClient())
                {
                    IEnumerable <DTO.AsycudaDocumentSetEx> res = null;
                    if (exp == "All" && navExp.Count == 0)
                    {
                        res = await t.GetAsycudaDocumentSetExs(includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }
                    else
                    {
                        res = await t.GetAsycudaDocumentSetExsByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaDocumentSetEx(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }