'Asp.Net Core : Get the value after siding in DbContext?

I want to seed a default value in the database...These values ​​include a role and a user. How can I take the role value after seed and add it to the next seed which is adding the user?Is this possible or not?

Seed Role :

modelBuilder.Entity<Role>().HasData(
            new Role { RoleId = Guid.NewGuid(), RoleName = "User" },
            new Role { RoleId = Guid.NewGuid(), RoleName = "Admin"}
        );

Seed User :

 modelBuilder.Entity<User>().HasData(
            new User { UserId = 1,RoleId = ?}
            );

Actually I want to get the Admin role ID and add it to the RoleId field in the User table?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source