public ActionResult Index() { var boatList = from boat in boatRepository.GetBoats() select boat; var boats = new List <BoatModel>(); if (boatList.Any()) { foreach (var boat in boatList) { boats.Add(new BoatModel() { BoatID = boat.ID, Name = boat.Name, HourlyRate = boat.HourlyRate, IsRegistered = boat.IsRegistered, IsRented = boat.IsRented }); } } return(View(boats)); }