Linq query in MVC
Hi,
I need to get the virtualuri value on the view. So these my model and view, I seem to miss something in this bit Url = q.ToString(); not sure what it is though, any advise would be appreciated.
On the View
I use this bit
<p>@Model.GetFriendlyUris(url)</p>
Model
public string GetFriendlyUris(string url)
{
using (TeachableEntities db = new TeachableEntities())
{
var q = (from r in db.site_urls where r.realuri == url select r.virtualuri);
Url = q.ToString();
}
return Url;
}