Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyNotFoundException: The given key 'xxxx.DataModel.Models.AspNetUserLogin' was not present in the dictionary. #74

Open
dorofino opened this issue Aug 6, 2023 · 1 comment

Comments

@dorofino
Copy link

dorofino commented Aug 6, 2023

Anyone can help find out why im getting this error?

KeyNotFoundException: The given key 'dbContext.DataModel.Models.AspNetUserLogin' was not present in the dictionary.

Snipaste_2023-08-05_23-57-18

Here is part of my Program.cs

builder.Services.AddSqlServer<dbContext>(builder.Configuration.GetConnectionString("DefaultConnectionLocal"));
 
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddApplicationInsightsTelemetry();

builder.Services.AddInstantAPIs();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}
 

app.UseSwagger();
app.UseSwaggerUI();

app.UseHttpsRedirection();

// Use CORS
app.UseCors();

app.UseAuthorization();

app.MapControllers();

app.MapInstantAPIs<dbContext>();

app.Run();
@eddozeynal
Copy link

Any fixes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants