Creating the models

Right-click on the Models folder in your project and add a class called ResearchModel.cs:

We actually need two classes—a Research class that is a representation of our entity object, and another, ResearchContext, which is a subclass of DbContext. To keep things simple, we can put both classes in our ResearchModel file.

Here's the code:

using Microsoft.EntityFrameworkCore; using System; namespace WebResearch.Models { public class Research { public int Id { get; set; } public string Url { get; set; } public DateTime DateSaved { get; set; } public string Note { get; set; } } public class ResearchContext : DbContext { 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.