1.8 KiB
1.8 KiB
title | author | description | manager | ms.author | ms.date | ms.prod | ms.technology | ms.topic | uid |
---|---|---|---|---|---|---|---|---|---|
Controller methods and views | rick-anderson | Working with controller methods, views and DataAnnotations | wpickett | riande | 03/07/2017 | asp.net-core | aspnet | get-started-article | tutorials/first-mvc-app/controller-methods-views |
Controller methods and views
We have a good start to the movie app, but the presentation isn't ideal. We don't want to see the time (12:00:00 AM in the image below) and ReleaseDate should be two words.
Open the Models/Movie.cs file and add the highlighted lines shown below:
Right click on a red squiggly line > Quick Actions and Refactorings.
Tap using System.ComponentModel.DataAnnotations;
Visual studio adds using System.ComponentModel.DataAnnotations;
.
Let's remove the using
statements that are not needed. They show up by default in a light grey font. Right click anywhere in the Movie.cs file > Remove and Sort Usings.
The updated code:
[!INCLUDEadding-model]