Пример #1
0
        ///// <summary>
        ///// Test Logs Data
        ///// </summary>
        //public static Lst[] Tl()
        //{
        //    var r = _.l<Lst>();

        //    var tc = true._Ls();
        //    tc.G(e => eGsl)

        //    //var a1 = new Lst();
        //    //a1.C = new Cde() { C = "Class 11", M = new Cme() { G = _.g, M = "Method 1111" }.L(new Cme() { G = _.g, M = "Method 1122" }) }
        //    //    .L(new Cde() { C = "Class 22", M = new Cme() { G = _.g, M = "Method 2211" }.L(new Cme() { G = _.g, M = "Method 2222" }) });
        //    //a1.E = new Err() { As = 4, C = "Err 1111" }.L(new Err() { As = 33, C = "Err 222" });
        //    //a1.En = new Env() { Ct = 20, Os = "dbs L 1111", S = "server L 11" }.L(new Sq() { T = 30, D = "dbs L 222", S = "server L 22" });
        //    //a1.Q = new Sq() { T = 20, D = "dbs Q 1111", S = "server Q 11" }.L(new Sq() { T = 30, D = "dbs Q 222", S = "server Q 22" });


        //    return r.a();
        //}

        #endregion

        #region common methods

        /// <summary>
        /// Run new Async common MethodToRunAsync using new context with logging settings and save logs after completed
        /// </summary>
        public static async Task R <T>(this Sld Settings, string ConnectionName, IDictionary <T, Cx> Contexts, T ContextKey, f <Ax <T>, Cx, Task> MethodToRunAsync, Mx MethodContext = null, bool Ensure = true)
        {
            var rs = ConnectionName.Gsl();
            var a  = Settings.N(async e => await e.ua(ConnectionName), Contexts);

            var rs1 = a.r(async x =>
            {
                await MethodToRunAsync(a, x);
                return(1);
            }, ContextKey, MethodContext);
            await a.L.Sva();
        }
Пример #2
0
        /// <summary>
        /// Run new Sync common MethodToRunSync using new context with logging settings and save logs after completed
        /// </summary>
        public static void r <T>(this Sld Settings, string ConnectionName, IDictionary <T, Cx> Contexts, T ContextKey, v <Ax <T>, Cx> MethodToRunSync, Mx MethodContext = null, bool Ensure = true)
        {
            var rs = ConnectionName.Gsl();
            var a  = Settings.N(async e => await e.ua(ConnectionName), Contexts);

            var rs1 = a.r(x =>
            {
                MethodToRunSync(a, x);
                return(1);
            }, ContextKey, MethodContext);

            a.L.Sv();
        }
Пример #3
0
 /// <summary>
 /// Get Common Sync Context with errors and performance with process details
 /// </summary>
 public Ax(Sld CurrSession, f <Lst, bool> SyncSaveLogsMethod, IDictionary <Tx, Cx> BaseContexts = null)
     : base(null, true)
 {
     T      = BaseContexts;
     L      = CurrSession.N(SyncSaveLogsMethod);
     this.M = () =>
     {
         if (L != null)
         {
             L.Sv();
         }
         return(true);
     };
 }
Пример #4
0
        /// <summary>
        /// Get Common Async Context with errors and performance with process details
        /// </summary>
        public Ax(Sld CurrSession, f <Lst, Task <bool> > AsyncSaveLogsMethod, IDictionary <Tx, Cx> BaseContexts = null)
            : base(null, true)
        {
            T      = BaseContexts;
            L      = CurrSession.N(AsyncSaveLogsMethod);
            this.M = () =>
            {
                if (L != null)
                {
                    var r = L.Sva();
                    if (r != null)
                    {
                        var rs = r.Result;
                    }
                }

                return(true);
            };
        }