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:
Родитель
0eeba65d51
Коммит
fc75faec59
|
@ -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>...
|
||||
";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче