add css class based on model value razor code example
Example: add css class based on model value razor
<div class="details @(@Model.Details.Count > 0 ? "show" : "hide")">
<div class="details @(@Model.Details.Count > 0 ? "show" : "hide")">