prasadnarwadkar_ASPNETCorePostgreSQL/ASPNETIdentityPostgres/Data/ApplicationDbContext.cs
using System;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace ASPNETIdentityPostgres.Data
{
    public class ApplicationRole : IdentityRole<Guid>
    {

    }

    public class ApplicationUser : IdentityUser<Guid>
    {
    }


    public class ApplicationDbContext : IdentityDbContext<ApplicationUser, ApplicationRole, Guid>
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            // Customize the ASP.NET Identity model and override the defaults if needed.
            // For example, you can rename the ASP.NET Identity table names and more.
            // Add your customizations after calling base.OnModelCreating(builder);

            // For Guid Primary Key
            builder.Entity<ApplicationUser>().Property(p => p.Id).ValueGeneratedOnAdd();

            // For int Primary Key
            //builder.Entity<ApplicationUser>().Property(p => p.ID).UseIdentityColumn();
        }
    }
}
