(Forgive me for saying the wrong things here because I am completely new to all this terminology. I undoubtedly will use the wrong terms when describing my problem.)
I am learning ASP.NET MVC with C#. I have a model that consists of three columns: EventStart
, EventEnd
, and Duration
. Duration
is derived from EventStart
and EventEnd
so I want to hide it from the Create and Edit views.
I found the DataAnnotation
called ScaffoldColumn
but that hides the column from all views.
The only thing that comes to mind is to delete this column from the views manually but the problem with that solution, of course, is that I will have to do that every time I change the model and rebuild the MVC scaffold.
What's the best way to do this?