Example #1
0
        //public IActionResult Error()
        //{
        //    return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        //}

        public PartialViewResult Test()
        {
            _logger.LogInformation("\n#### Using AppLogger Warning####\n");
            ViewData["Message"] = "Test Ajax";
            ServiceLocatorTool serviceLocator = new ServiceLocatorTool();
            SubscriptionFacade facade         = new SubscriptionFacade();

            var subs = facade.SubscriptionFacade1();
            var res  = PartialView(new HomePageViewModel {
                Test1 = "Acc No.:-" + subs.Result[0].parentAccountNo.ToString(), Test2 = "Test 2"
            });

            return(res);

            //catch (Exception ex)
            //{
            //    var result = PartialView(new ErrorViewModel { RequestId = "RequestId" + ex.StackTrace.ToString()});
            //    return result;
            //}
        }
Example #2
0
        public IEnumerable <Subscription> GetSubscriptions()
        {
            Log.Error("Executing GetSubscription..");
            Log.Warning("THIS IS A WARNING FROM MY CODE...");
            try
            {
                var i = 10;
                i = i / 0;
            }
            catch (Exception ex)
            {
                Log.Fatal(ex.Message);
            }
            ServiceLocatorTool serviceLocator = new ServiceLocatorTool();
            // SubscriptionFacade facade = new SubscriptionFacade(serviceLocator.ObjServiceLocator);
            SubscriptionFacade facade = new SubscriptionFacade();
            var subs    = facade.SubscriptionFacade1();
            var results = subs.Result.ToList();

            return(results.AsEnumerable());
        }