Register a Context with dependency injection container in Blazor Application
Posted: Wed 10 Mar 2021 18:08
I have a MS SQL Server database which I have built a LinqConnect Model on top of. I am learning .NET COre and specifically Blazor. I cannot figure out how to register the context with my .NET Core Blazor application in the startup.cs.
The following results in a type conversion error. "There is no implicit reference conversion from MyLinqConnectDBCtx to Microsoft.EntityFrameworkCore.DbContext".
I have looked everywhere and can find no guidance on this at all. It means it's probably something dumb on my part but I got no idea what to try at this point.
The following results in a type conversion error. "There is no implicit reference conversion from MyLinqConnectDBCtx to Microsoft.EntityFrameworkCore.DbContext".
Code: Select all
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<MyLinqConnectDBCtx>(options => options.UseSqlServer(connstring));
}