0
I did a query in Latin, but the result was not as expected, it seems simple the problem but I can not solve.
Result on the label:
{ Year = 2016/2017 }
Expected result on label:
2016/2017
Controller:
//query
var queryAnoPastoral = (from a in db.AnoPastoral
orderby a.AnoPastoralID descending
select new { a.Ano }).First();
ViewBag.AnoPastoral = queryAnoPastoral.ToString();
View:
@Html.Label((string)@ViewBag.AnoPastoral, htmlAttributes: new { @class = "control-label col-md-2" })