Hi,
I'm trying to learn blazor from online tutorials and now I encounter a problem:
When I write this entity I see a red line under both "options".
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.EntityFrameworkCore;
namespace todo_try1.Data
{
public class ApplicationDbContext : IdentityDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
public DbSet<ToDo> ToDoList { get; set; }
//public DbSet<Category> Categories { get; set; }
//public DbSet<Product> Products { get; set; }
public override int SaveChanges()
{
return base.SaveChanges();
}
}
}And when I build the project VS alarms me:
Severity Code Description Project File Line Suppression State
Error CS0311 The type 'todo_try1.Data.ApplicationDbContext' cannot be used as type parameter 'TContext' in the generic type or method 'DbContextOptions<TContext>'. There is no implicit reference conversion from 'todo_try1.Data.ApplicationDbContext' to
'Microsoft.EntityFrameworkCore.DbContext'. todo_try1 E:\Blazor_Try\todo_try1\todo_try1\Data\ApplicationDbContext.cs 12 Active
Please guide me to solve this problem.
TNX