AspNetCore.Docs/aspnetcore/includes/mvc-intro/adding-model3.md

1.4 KiB

Test the app

  • Run the app and tap the Mvc Movie link.

  • Tap the Create New link and create a movie.

    Create view with fields for genre, price, release date, and title

  • You may not be able to enter decimal points or commas in the Price field. To support jQuery validation for non-English locales that use a comma (",") for a decimal point, and non US-English date formats, you must take steps to globalize your app. See https://github.com/aspnet/Docs/issues/4076 and Additional resources for more information. For now, just enter whole numbers like 10.

  • In some locales you need to specify the date format. See the highlighted code below.

[!code-csharpMain]

We'll talk about DataAnnotations later in the tutorial.

Tapping Create causes the form to be posted to the server, where the movie information is saved in a database. The app redirects to the /Movies URL, where the newly created movie information is displayed.

Movies view showing newly created movie listing

Create a couple more movie entries. Try the Edit, Details, and Delete links, which are all functional.