I havent really found a solution seaching through SO.
...and suspect I should really do this in the Model...
but is it possible to have C# code blocks where adhoc code can be added eg:
@int daysLeft = CurrentTenant.TrialExpiryDate.Subtract(DateTimeOffset.Now).Days
@if (daysLeft <= 0) {
{
<text>
Trial period completed
</text>
}
else
{
<text>
You have @daysLeft days left of you trial
</text>
}
Sure it is:
@{
var one = 1;
var two = one + one;
}
Phil Haack has a pretty popular blog post summing up Razor syntax.
You can create functions in razor which is what I believe you are looking for.
Another explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With