Add user profile fields and completion prompt
Build and Push Docker Image / build-and-push (push) Successful in 23s
Build and Push Docker Image / build-and-push (push) Successful in 23s
Added `FirstName`, `LastName`, and `Address` fields to `ApplicationUser` for extended user profiles. Updated `Index.razor` to include these fields in the profile form with validation. Introduced `ProfileCompletionService` to check profile completeness and added a prompt in `TopBar.razor` for incomplete profiles. Created migration `20260518213355_AddUserProfileFields` to update the database schema. Updated `RegistryService` to use new fields for user display names. Registered `ProfileCompletionService` and `DbContextFactory` in `Program.cs`. Styled the profile completion banner in `TopBar.razor.css`.
This commit is contained in:
@@ -90,6 +90,17 @@ builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
||||
options.UseSqlite(connectionString);
|
||||
});
|
||||
|
||||
builder.Services.AddDbContextFactory<ApplicationDbContext>(options =>
|
||||
{
|
||||
if (string.Equals(dataProvider, "SqlServer", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
options.UseSqlServer(connectionString);
|
||||
return;
|
||||
}
|
||||
|
||||
options.UseSqlite(connectionString);
|
||||
}, ServiceLifetime.Scoped);
|
||||
|
||||
builder.Services.AddDbContext<RegistryDbContext>(options =>
|
||||
{
|
||||
if (string.Equals(dataProvider, "SqlServer", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -113,6 +124,7 @@ builder.Services.AddIdentityCore<ApplicationUser>(options =>
|
||||
|
||||
builder.Services.AddScoped<SmtpEmailSender>();
|
||||
builder.Services.AddScoped<IEmailSender<ApplicationUser>>(serviceProvider => serviceProvider.GetRequiredService<SmtpEmailSender>());
|
||||
builder.Services.AddScoped<ProfileCompletionService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user