You can use the LINQ All method.
@if(!Model.PaymentList.All(f=>f.Status=="Paid"))
{
<button>click me</button>
}
Or the Any
method
@if(Model.PaymentList.All(f=>f.Status!="Paid"))
{
<button>click me</button>
}
1
solved Hiding button if all status is “Paid” using LINQ [closed]