Example #1
0
 public void AutoExecute()
 {
     CodeTrackFactory.Level = CodeTrackLevel.All;
     using (CodeTrackFactory.TrackReport("AutoExecute", CodeTrackLevel.Bussiness, null, "EFCore", "BeetleX"))
     {
         using (NorthwindContext db = new NorthwindContext())
         {
             DBValueList <string>        values = (db, "select customerid from customers");
             DBObjectList <CustomerName> items  = (db, "select CustomerID,CompanyName from customers");
             DBExecute <string>          id     = (db, "select CompanyName from customers where CustomerID='ALFKI'");
             DBExecute execute = (db, "delete from customers", " delete from orders");
         }
     }
     this.Console.WriteLine(CodeTrackFactory.Activity?.GetReport());
 }
Example #2
0
        static async Task Main(string[] args)
        {
            CodeTrackFactory.Level             = CodeTrackLevel.Code;
            DefaultRedis.Instance.DataFormater = new JsonFormater();
            DefaultRedis.Instance.Host.AddWriteHost("127.0.0.1");
            var subscribe = DefaultRedis.Subscribe();

            subscribe.Register <Employee>("employees", e =>
            {
                Console.WriteLine($"Receive employee {e.FirstName} {e.LastName}");
            });
            subscribe.Listen();
            System.Threading.Thread.Sleep(1000);
            using (CodeTrackFactory.TrackReport("Test", CodeTrackLevel.Bussiness, null))
            {
                await Test();
            }
            Console.WriteLine(CodeTrackFactory.Activity?.GetReport());
            Console.Read();
        }
Example #3
0
        public async Task <Response> Execute()
        {
#if NETCOREAPP2_1
            using (mRequestTrack = CodeTrackFactory.TrackReport(this, CodeTrackLevel.Module, null))
            {
                if (Activity.Current != null)
                {
                    Header[CODE_TREAK_PARENTID] = Activity.Current.Id;
                }
                if (mRequestTrack.Enabled)
                {
                    mRequestTrack.Activity?.AddTag("tag", "BeetleX HttpClient");
                }
#endif
            Executing?.Invoke(this);
            mTaskCompletionSource         = CompletionSourceFactory.Create <Response>(TimeOut != null ? TimeOut.Value : HttpHost.Pool.TimeOut); // new AnyCompletionSource<Response>();
            mTaskCompletionSource.TimeOut = OnRequestTimeout;
            OnExecute();
            return(await(Task <Response>) mTaskCompletionSource.GetTask());

#if NETCOREAPP2_1
        }
#endif
        }