I need assistance with getting the syntax correct for this code on my razor page:
@foreach (var officerGroup in Model.Results
.Where(i => i.InvestType in ("YO", "CRD", "PPI", "PSI")
.GroupBy(x => x.ProbOfficer))
Basically, I want to filter by a specific subset of InvestType values in this particular section of a report. There are other values for InvestType that I DON'T wish to include. I don't know how to do an "in" type of statement.
Thanks for any help you can provide.
You can use
@{ ... }to declare variables inside a.cshtmlfile:Or you can add it in your
PageModellike this:and in the
.cshtml: