Use ViewModel. This is the class that you declare, having the properties that you want to display in your view.
For instance:
var country = TrendDB.Countries.FirstOrDefault(c => c.CountryId == id);
CountryDetails details = new CountryDetails();
details.FirstValueToShow = country.Name;
return View(details);
Remember to clearly indicate your view of the information in the ViewModel.
source
share