I have a View that displays the Customer Details.
I would like to display age by the Date of Birth available.
I tried some thing like this.
@Html.DisplayTextFor(model => DateTime.Now.Date.Subtract(model.DOB))
where model.DOB has a value like 7/23/1985 12:00:00 AM
That gives me an error
Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
Can you please help me how i can display age with the Date of Birth i have.