Estoy intentando lo siguiente para filtrar en la vista, pero me arroja error:
Operator '==' cannot be applied to operands of type 'method group' and 'int'
Codigo donde me lanza el error:
@if (Model.BariatricVisits.Where(p=>p.IsActive==true).Count == 0)
Código completo:
@model Domain.MED.Bariatric
@{
ViewBag.Title = "Historia Bariatrica";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@Html.AntiForgeryToken()
<div class="form-horizontal">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.HiddenFor(model => model.PatientId)
@Html.HiddenFor(model => model.BariatricId)
<div>
<a class="btn btn-primary" href="@Url.Action("CreatePediatricVisits",
"Patients", new { area = "Medicals", id = @Model.PediatricId })">
<span class="fa fa-plus"></span> Registrar Visita</a>
@if (Model.BariatricVisits.Where(p=>p.IsActive==true).Count == 0)
{
<h2>No existen Visitas Pre Quirurgicas registradas aun :'(</h2>
}
else
{
//..
}