Fix identityuser being used instead of DbApplicationUser
This commit is contained in:
parent
bdb3475685
commit
d2e156b9f1
4 changed files with 6 additions and 4 deletions
|
@ -33,6 +33,8 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
|
|||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
// Company
|
||||
modelBuilder.Entity<DbCompany>(entity =>
|
||||
{
|
||||
|
@ -216,6 +218,5 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
|
|||
.WithMany();
|
||||
});
|
||||
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
namespace DrinkRateAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20250809141112_init")]
|
||||
[Migration("20250809145003_init")]
|
||||
partial class init
|
||||
{
|
||||
/// <inheritdoc />
|
|
@ -1,4 +1,5 @@
|
|||
using DrinkRateAPI.Contexts;
|
||||
using DrinkRateAPI.DbEntities;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
@ -11,7 +12,7 @@ builder.Services.AddControllers();
|
|||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddAuthorization();
|
||||
builder.Services.AddIdentityApiEndpoints<IdentityUser>()
|
||||
builder.Services.AddIdentityApiEndpoints<DbApplicationUser>()
|
||||
.AddEntityFrameworkStores<ApplicationDbContext>();
|
||||
|
||||
builder.Services.AddSwaggerGen(c =>
|
||||
|
@ -60,7 +61,7 @@ if (app.Environment.IsDevelopment())
|
|||
app.MapSwagger().RequireAuthorization();
|
||||
}
|
||||
|
||||
app.MapIdentityApi<IdentityUser>();
|
||||
app.MapIdentityApi<DbApplicationUser>();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
|
|
Loading…
Reference in a new issue