Exemple #1
0
        public async Task <IEnumerable <AsycudaDocument> > AsycudaDocuments(List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                return(new List <AsycudaDocument>().AsEnumerable());
            }
            try
            {
                using (var t = new AsycudaDocumentClient())
                {
                    var res = await t.GetAsycudaDocuments(includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaDocument(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
 private void UpdateAsycudaDocument()
 {
     using (var ctx = new AsycudaDocumentClient())
     {
         var dto = ctx.GetAsycudaDocuments().Result.FirstOrDefault(x => x.ASYCUDA_Id == this.AsycudaDocumentId);
         if (dto != null)
         {
             AsycudaDocument = new AsycudaDocument(dto);
         }
     }
 }
Exemple #3
0
        public async Task <IEnumerable <AsycudaDocument> > GetAsycudaDocumentsByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new List <AsycudaDocument>().AsEnumerable());
            }
            try
            {
                using (var t = new AsycudaDocumentClient())
                {
                    IEnumerable <DTO.AsycudaDocument> res = null;
                    if (exp == "All" && navExp.Count == 0)
                    {
                        res = await t.GetAsycudaDocuments(includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }
                    else
                    {
                        res = await t.GetAsycudaDocumentsByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }

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