AspNetCore.Docs/aspnetcore/tutorials/first-mvc-app-xplat/controller-methods-views.md

38 lines
1.3 KiB
Markdown
Raw Normal View History

---
2017-07-01 07:47:15 +08:00
title: Controller methods and views
author: rick-anderson
description: Working with controller methods, views and DataAnnotations
ms.author: riande
manager: wpickett
ms.date: 04/07/2017
ms.topic: get-started-article
ms.technology: aspnet
ms.prod: asp.net-core
uid: tutorials/first-mvc-app-xplat/controller-methods-views
---
# Controller methods and views
By [Rick Anderson](https://twitter.com/RickAndMSFT)
We have a good start to the movie app, but the presentation is not ideal. We don't want to see the time (12:00:00 AM in the image below) and **ReleaseDate** should be two words.
![Index view: Release Date is one word (no space) and every movie release date shows a time of 12 AM](../../tutorials/first-mvc-app/working-with-sql/_static/m55.png)
Open the *Models/Movie.cs* file and add the highlighted lines shown below:
[!code-csharp[Main](../../tutorials/first-mvc-app/start-mvc/sample/MvcMovie/Models/MovieDate.cs?name=snippet_1&highlight=2,11-12)]
Build and run the app.
<!-- include start
![MVC Movie application open browser showing movie data](../../tutorials/first-mvc-app/working-with-sql/_static/m55.png)
-->
[!INCLUDE[adding-model](../../includes/mvc-intro/controller-methods-views.md)]
>[!div class="step-by-step"]
2017-04-15 01:46:51 +08:00
[Previous - Working with SQLite](working-with-sql.md)
2017-09-20 15:36:55 +08:00
[Next - Add search](search.md)