When we use ASP.NET MVC framework we have the famous AspNetUsers table, which contains an unique Id for each user. I want to generate data in other tables based on the upon created 'fake' users. How can I pull the Id (from AspNetUsers) that was actually generated for other tables like 'ProfileTable'?
for (var i = 0; i < names.Count(); i++)
{
AspNetUserFaker = new Faker<AspNetUser>().StrictMode(false)
.RuleFor(a => a.Id, f => Guid.NewGuid().ToString()) // Randomly
.RuleFor(a => a.FirstName, (f, u) => firstNames[i]) // Preselected known names
.RuleFor(a => a.LastName, (f, u) => lastNames[i])
...
}
then
ProfileFaker = new Faker<ProfileTable>().StrictMode(false)
// Get Id from the previously created, has to come from AspNetUsers, and only inserted once on this table
.RuleFor(a => a.MemberID, f => f.IndexFaker) // <-- Need help here
.RuleFor(a => a.About, f => f.Lorem.Words())
...