public ActionResult Index() { logger.Info("url visited by user:/apartment/Index"); //Adding url details into logger. IEnumerable <IGrouping <string, Apartment> > apartments = service.GroupApartments(); //Retrieving list of all the apartments calling service method. return(View(apartments)); }