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