Check out example codes for ".net identity seed users and roles". It will help you in understanding the concepts better.

Code Example 1

public static void Main(string[] args)
{
    var host = BuildWebHost(args);

    using (var scope = host.Services.CreateScope())
    {
        var serviceProvider = scope.ServiceProvider;
        try
        {
            var userManager = serviceProvider.
GetRequiredService<UserManager<MyIdentityUser>>();

            var roleManager = serviceProvider.
GetRequiredService<RoleManager<MyIdentityRole>>();

            MyIdentityDataInitializer.SeedData
(userManager, roleManager);
          	// Add Users and Roles
        }
        catch
        {
                   
        }
    }
    host.Run();
}

Learn ReactJs, React Native from akashmittal.com