Ejemplo n.º 1
0
        public async Task <IEnumerable <ContainerEx> > ContainerExes(List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                return(new List <ContainerEx>().AsEnumerable());
            }
            try
            {
                using (var t = new ContainerExClient())
                {
                    var res = await t.GetContainerExes(includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new ContainerEx(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <ContainerEx> > GetContainerExesByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new List <ContainerEx>().AsEnumerable());
            }
            try
            {
                using (var t = new ContainerExClient())
                {
                    IEnumerable <DTO.ContainerEx> res = null;
                    if (exp == "All" && navExp.Count == 0)
                    {
                        res = await t.GetContainerExes(includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }
                    else
                    {
                        res = await t.GetContainerExesByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }

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