Esempio n. 1
0
        public GetOrderResponse GetOrder(GetOrderRequest request)
        {
            var rnd  = new Random();
            var ctx1 = Audit.WCF.AuditBehavior.CurrentAuditScope;

            Thread.Sleep(rnd.Next(2, 100));
            ctx1.SetCustomField("Test-Field-1", request.OrderId);
            Thread.Sleep(rnd.Next(2, 100));
            var ctx2 = Audit.WCF.AuditBehavior.CurrentAuditScope;

            ctx2.SetCustomField("Test-Field-2", request.OrderId);

            return(new GetOrderResponse()
            {
                Success = true,
                Order = new Order()
                {
                    OrderId = request.OrderId
                }
            });
        }
Esempio n. 2
0
        public async Task <GetOrderResponse> GetOrder2Async(GetOrderRequest request)
        {
            var rnd  = new Random();
            var ctx1 = Audit.WCF.AuditBehavior.CurrentAuditScope;

            ctx1.SetCustomField("Test-Field-1", request.OrderId);
            await Task.Delay(rnd.Next(2, 100));

            var ctx2 = Audit.WCF.AuditBehavior.CurrentAuditScope;

            ctx2.SetCustomField("Test-Field-2", request.OrderId);
            await Task.Delay(rnd.Next(2, 100));

            return(new GetOrderResponse()
            {
                Success = true,
                Order = new Order()
                {
                    OrderId = request.OrderId
                }
            });
        }