adding a readme for blazor identity for scenario specific information. (#2999)

* adding a readme for blazor identity for scenario specific information.

* PR suggestions added.

* updated to fwlink
This commit is contained in:
Deep Choudhery 2024-10-07 17:32:24 -07:00 коммит произвёл GitHub
Родитель 0eeba65d51
Коммит fc75faec59
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -141,9 +141,18 @@ namespace Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Blazor
var blazorTemplateModel = await ValidateAndBuild(model);
ExecuteTemplates(blazorTemplateModel);
AddReadmeFile(blazorTemplateModel.BaseOutputPath);
await ModifyFilesAsync(blazorTemplateModel);
}
internal void AddReadmeFile(string outputPath)
{
string fileName = BlazorIdentityHelper.BlazorIdentityReadmeFileName;
string readmeFilePath = Path.Combine(outputPath, fileName);
FileSystem.WriteAllText(readmeFilePath, BlazorIdentityHelper.BlazorIdentityReadmeString);
Logger.LogMessage($"Added Blazor identity file : {fileName}");
}
internal async Task<BlazorIdentityModel> ValidateAndBuild(BlazorIdentityCommandLineModel commandlineModel)
{
commandlineModel.DatabaseProvider = ModelMetadataUtilities.ValidateDatabaseProvider(commandlineModel.DatabaseProviderString, Logger, isIdentity: true);

Просмотреть файл

@ -101,5 +101,23 @@ namespace Microsoft.VisualStudio.Web.CodeGenerators.Mvc.BlazorIdentity
return filteredChanges;
}
internal static string BlazorIdentityReadmeFileName = "Scaffolding-README.md";
internal static string BlazorIdentityReadmeString =
@"Blazor Identity scaffolding has completed successfully.
For setup and configuration information, see https://go.microsoft.com/fwlink/?linkid=2290075.
If the project had identity support prior to scaffolding, ensure that the following changes are present in Program.cs:
1. Correct DbContextClass is used in the following statements :
- var connectionString = builder.Configuration.GetConnectionString(DBCONTEXT_CONNECTIONSTRING) ...
- builder.Services.AddDbContext<DBCONTEXT>(options => ...
- builder.Services.AddIdentityCore<IDENTITY_USER_CLASS>...
.AddEntityFrameworkStores<DBCONTEXT>() ...
2. Correct Identity User class is being used, (if using the default 'IdentityUser' or a custom IdentityUser class).
- builder.Services.AddIdentityCore<IDENTITY_USER_CLASS>...
- builder.Services.AddSingleton<IEmailSender<IDENTITY_USER_CLASS>...
";
}
}