How do I count rows in a table that meet a condition. Below counts every row regardless of whether or not a condition is met.
model IEnumerable<Sales1.Models.UserProfile>
@{
ViewBag.Title = "Details";
}
Total Sales Figures
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
foreach(var item in Model){
if (item.Device_DeviceID != null)
{
@Model.Count()
}
} }`