When I call this code, I notice that there is a brief pause before I receive variable called state.
Order od = _orderService.GetOrderById(1) string state = od.BillingAddress.StateProvince.Abbreviation; string country = od.BillingAddress.Country.Name;
Is there a way to disable lazy loading? My goal is to pull a summary of orders per day from nopCommerce. When I enumerate through the orders, it takes about 3 - 4 seconds to pull the state and country.
Each call to GetOrderById() is going to be a separate SQL call (unless order is cached). If you're 'reporting', then it's better to go directly against the order repository - e.g. see
What if I call SearchOrders? I have 50 orders and each time I expand state or country, the code goes back to the database. How do I prevent this behavior?
I have the same problem. I need to load the Order.BillingAddress.Region and Order.BillingAddress.Country, after the query has run. How do I disable lazy loading on the repository? Is there a setting?