Add new user creation
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
using Hcs.WebApp.Components;
|
||||
using Hcs.WebApp.Components.Shared;
|
||||
using Hcs.WebApp.Data;
|
||||
using Hcs.WebApp.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Radzen;
|
||||
using Radzen.Blazor;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@ -19,10 +22,8 @@ builder.Services.AddHeaderPropagation(x => x.Headers.Add("Cookie"));
|
||||
builder.Services.AddAuthentication();
|
||||
builder.Services.AddAuthorization();
|
||||
|
||||
builder.Services.AddScoped<IdentityService>();
|
||||
|
||||
var connectionString = builder.Configuration.GetConnectionString("IdentityConnection") ?? throw new InvalidOperationException("<22><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 'IdentityConnection'");
|
||||
builder.Services.AddDbContext<AppIdentityDbContext>(options => options.UseSqlServer(connectionString));
|
||||
builder.Services.AddDbContextFactory<AppIdentityDbContext>(options => options.UseSqlServer(connectionString));
|
||||
|
||||
builder.Services
|
||||
.AddIdentity<AppUser, AppRole>(options =>
|
||||
@ -42,6 +43,12 @@ builder.Services.AddTransient<IClientProvider, MockClientProvider>();
|
||||
#else
|
||||
builder.Services.AddTransient<IClientProvider, ClientProvider>();
|
||||
#endif
|
||||
builder.Services.AddScoped<IdentityService>();
|
||||
builder.Services.AddScoped<UsersService>();
|
||||
|
||||
var activator = new RadzenComponentActivator();
|
||||
activator.Override(typeof(RadzenDataGrid<>), typeof(LocalizedRadzenDataGrid<>));
|
||||
builder.Services.AddSingleton<IComponentActivator>(activator);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user