Code:
public class RepositoryContext : DbContext
{
public RepositoryContext(DbContextOptions options)
: base(options)
{
}
}
error:
The type or namespace name 'DbContextOptions' could not be found (are you missing a using directive or an assembly reference?)
Repository D:\My Work\Algos\Repository\RepositoryContext.cs
I am trying to create a DbContext
class here. Is there any issue?
What is missing here? Do I need some namespaces also?
I am getting this error for the first time.
You referenced EntityFramework instead of EntityFrameworkCore.
You need this package: https://www.nuget.org/packages/Microsoft.EntityFrameworkCore
And this namespace: using Microsoft.EntityFrameworkCore;