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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.