I have an object called Radio
:
public class Radio
{
public int RadioId { get; set; }
public string StreamUrl { get; set; }
public bool Ativo { get; set; }
public bool Mp3 { get; set; }
}
I'm doing a select in controller and trying to send it to View :
var RadioAtivo = db.Radios
.Where(p => p.Ativo == true && p.Mp3 == false)
.Take(1);
return View(RadioAtivo.ToList());
In view , I would like to retrieve, for example, the field StreamURL
@model List<RadioFM.Domain.Domain.Radio>
<p>@Html.DisplayFor(r => r.???) </p>
I thought I'd put in a ViewBag
, but I found it a bit tricky. I thought about creating a ViewModel
already with the data, but I thought it would sort of duplicate a problem.
What is the simplest solution in this case?