I'm having issues do linq queries inside of a code block.
@{
var foo = @Model.Things.Select((value, index) => new { value, index });
}
The problem is the new{}, it sees the second bracket as closing the entire code block. Any way to escape it?
Remove the @
from Model
:
@{
var foo = Model.Things.Select((value, index) => new { value, index });
}
Please try
@{
var foo = Model.Things.Select((value, index) => new { value, index });
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With