hi.
I got this query below that's printing rows with curly braces '{' in view. How can I fix that?
Lambda Query:
var q = db.table1.Where(n => n.user== USER).Select(n => new { n.Name, n.LastName });
ViewBag.test = q;View:@foreach (var item in ViewBag.test) { @item }Output: { Name = john, LastName=Smith} { Name = Mike, LastName=mojie}
Thanks in advance
arun prasathPosted Oct 6, 2014, 7:57 AM
VulpesPosted Sep 29, 2014, 5:33 PM
var q = db.table1.Where(n => n.user== USER)
.Select(n => String.Format("{0}, {1}", n.Name, n.LastName));
ViewBag.test = q;