I need to query multiple columns using Linq query and as far as I know I need to use the Curly braces '{}'
I wrote the following query but for some strange reason its printing the opening and closing braces '{}' that's in the statement.
var q = db.table1.Where(n => n.user== USER).Select(n => new { n.Name, n.LastName });
ViewBag.test = q;
In My View
@foreach (var item in ViewBag.test)
{
@item
}
Output:
{ Name = john, LastName=Smith}
{ Name = Mike, LastName=mojie}
Why is it printing the curly braces?!