Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

problem with the entity

$
0
0

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


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>