Hi.
According to your recommendations, we should not use IdentityUser/IdentityUserRole in our application. Please add basic AppUser infrastructures to application templates.
Thanks in advance.
That can be good.
AppUser to the domain project.AbpUsers table between the application and the Identity module.MyProjectNameMigrationsDbContext, to manage db migrations.IRepository<AppUser, Guid> as use as normally you do.AppUser class, I have written comments.AppUser class:csharp
public virtual int Reputation { get; set; }
MyProjectNameDbContextModelCreatingExtensions.ConfigureCustomUserProperties method:csharp
b.Property<int>(nameof(AppUser.Reputation)).IsRequired().HasDefaultValue(1);
Add-Migration "Added_AppUser_Reputation"
This will produce a migration like this:
````csharp
public partial class Added_AppUser_Reputation : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn
name: "Reputation",
table: "AbpUsers",
nullable: false,
defaultValue: 1);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Reputation",
table: "AbpUsers");
}
}
````
Update-Database
Most helpful comment
What's done?
AppUserto the domain project.AbpUserstable between the application and the Identity module.MyProjectNameMigrationsDbContext, to manage db migrations.How To Use?
IRepository<AppUser, Guid>as use as normally you do.AppUserclass, I have written comments.Example: Adding a new property to the AppUser
AppUserclass:csharp public virtual int Reputation { get; set; }MyProjectNameDbContextModelCreatingExtensions.ConfigureCustomUserPropertiesmethod:csharp b.Property<int>(nameof(AppUser.Reputation)).IsRequired().HasDefaultValue(1);Add-Migration "Added_AppUser_Reputation"This will produce a migration like this:
````csharp(
public partial class Added_AppUser_Reputation : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn
name: "Reputation",
table: "AbpUsers",
nullable: false,
defaultValue: 1);
}
}
````
Update-Database