Generate Test Data data using using GenFu and C#

Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 2303
Let us create a Entity as

public class Person
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAdress { get; set; }
public string PhoneNumber { get; set; }

public override string ToString()
return $"{Id}: {FirstName} {LastName} - {EmailAdress} - {PhoneNumber}";


Then add GenFu through the Nuget package manager as under

Install-Package GenFu

Finally generate the data

public static void Main(String[] args)
//Generate 100 random data

Comments or Responses

Login to post response