Lazy Loading
Lazy loading is a concept where we delay the loading of the object until the point where we need it. Putting in simple words, on demand object loading rather than loading objects unnecessarily. For example, consider the below example where we have a simple Customer class and this Customer class has many Order objects inside it. Have a close look at the constructor of the Customer class. When the Customer object is created it also loads the Order object at that moment. So even if we need or do not need the Order object, it’s still loaded. But how about just loading the Customer object initially and then on demand basis load the Order object? Hide Copy Code public class Customer { private List<Order> _Orders= null ; … … public Customer() { _CustomerName = " Shiv" ; _Orders = LoadOrders(); // Loads the order object even though //not needed } private List<Order> LoadOrders() { List<Order...