dotnet / dotnet/Scaffolding

Blazor Identity scaffolder should generate a DbContext with a unique name

Open
#2,882 0 comments 0 reactions 1 assignee Claimed by @NanthiniMahalingam View on GitHub
area-blazor area-scaffolding
Dominant language
C#
Stars
818
Forks
260
Avg merge
1d 8h
Merged PRs (30d)
10

Description

If I use the Blazor Identity scaffolder to generate an IdentityDbContext type it doesn't seem to detect if a type already exists with the suggested default name. You then get the following error when running the Blazor Identity scaffolder:

![image](https://github.com/user-attachments/assets/6c98c121-ae83-4022-bae7-caebd045def1)

I hit this when I run the Blazor Identity scaffolder after running the Blazor CRUD scaffolder, which uses the same default suggested name for the generated DbContext.

Repro steps:

- Create a Blazor Web App
- Run the Blazor CRUD scaffolder and generate a DbContext using the default name
- Run the Blazor Identity scaffodler and generate an IdentityDbContext using the default name

Actual result: Error complaining that the DbContext isn't an IdentityDbContext
Expected result: The suggested name for the IdentityDbContext is unique

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.