/// <summary> /// AddOrUpdate common data storage /// </summary> public static bool u <T>(this T ElementToUpdate, string ConnectionName) where T : class { if (ElementToUpdate == null || ConnectionName == null) { return(false); } var cs = new DCx <T>(ConnectionName); cs.U(c => { c.d1.AddOrUpdate(ElementToUpdate); }); return(true); }
/// <summary> /// AddOrUpdate common data storage /// </summary> public static async Task <bool> Ua <T>(this T[] ElementsToUpdate, string ConnectionName) where T : class { if (ElementsToUpdate == null || ConnectionName == null) { return(false); } var cs = new DCx <T>(ConnectionName); await cs.Ua(c => { c.d1.AddOrUpdate(ElementsToUpdate); }); return(true); }
/// <summary> /// Get common data storage /// </summary> public static IEnumerable <T1> Gd <T1, T2, T3>(this string ConnectionName, f <IQueryable <T1>, IQueryable <T1> > MethodToInclude, f <IQueryable <T2>, IQueryable <T2> > MethodToInclude2, f <IQueryable <T3>, IQueryable <T3> > MethodToInclude3 = null, f <T1, bool> MethodToSelect = null, bool EnsureStructure = true) where T1 : class where T2 : class where T3 : class { if (ConnectionName == null) { return(null); } var cs = new DCx <T1, T2, T3>(ConnectionName); if (EnsureStructure) { cs.N(); } IQueryable <T1> resq = null; IEnumerable <T1> res = null; IEnumerable <T2> res2 = null; IEnumerable <T3> res3 = null; cs.R(c => { if (MethodToInclude != null) { resq = MethodToInclude(c.d1); } else { resq = c.d1; } if (MethodToSelect != null) { res = resq.w(e => MethodToSelect(e)); } else { res = resq.ToArray(); } if (MethodToInclude2 != null) { res2 = MethodToInclude2(c.d2).w(e => e != null); } if (MethodToInclude3 != null) { res3 = MethodToInclude3(c.d3).w(e => e != null); } }); return(res); }