private BoatModel GetBoatDetails(int id) { var boatDetails = boatRepository.GetBoatByID(id); var boat = new BoatModel(); if (boatDetails != null) { boat.BoatID = boatDetails.ID; boat.Name = boatDetails.Name; boat.HourlyRate = boatDetails.HourlyRate; boat.IsRegistered = boatDetails.IsRegistered; boat.IsRented = boatDetails.IsRented; } return(boat); }