Hooking it all up

To simplify things, we will be creating a model to pass to our controller:

  1. Create a new class in the Models folder of your application called LoginModel and click on the Add button:
  1. Your project should now look as follows. You will see the model added to the Models folder:
  1. The next thing we want to do is add some code to our model to represent the fields on our login form. Add two properties called Email and Password:
 namespace CoreMailValidation.Models { public class LoginModel { public string Email { get; set; } public ...

Get C# 7 and .NET Core 2.0 Blueprints now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.