I am trying to generate 3000 fake records in C# with condition that each 1000 items will have same time stamp(update_time
) in UTC milliseconds, then next 1000 will have same time stamp in UTC milliseconds. how to achieve that?
private static IReadOnlyCollection<Document> GetDocumentsToInsert()
{
return new Bogus.Faker<Document>()
.StrictMode(true)
//Generate item
.RuleFor(o => o.id, f => Guid.NewGuid().ToString()) //id
.RuleFor(o => o.update_time, f => DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();)
.Generate(3000);
}
// <Model>
public class Document
{
public string update_time {get;set;}
public string id{get;set;}
}
I am not familiar with Faker but it looks like you want something like: