ceci bela

ceci bela

  • NA
  • 58
  • 12.2k

lambda query printing curly braces '{' in result

Sep 29 2014 5:11 PM
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 

Answers (2)