-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
64 lines (53 loc) · 1.71 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* This project is to show how to use GenFu to generate dummy data.
* GenFu home page: http://genfu.io/
* GitHub of GenFu: https://github.com/MisterJames/GenFu/
* Credit belongs to the creators of GenFu.
* I merely try to give a simple example of GenFu usage since I think this is a quick way to generate dummy data.
*/
using System;
using System.Linq;
namespace GenFuUsageSample
{
class Program
{
static void Main(string[] args)
{
var contacts = GenFu.GenFu.ListOf<Contact>();
foreach (var contact in contacts.OrderBy(x => x.Id))
{
Console.WriteLine(contact.ToString());
}
Console.WriteLine(string.Empty);
var books = GenFu.GenFu.ListOf<Book>();
foreach (var book in books)
{
Console.WriteLine(book.ToString());
}
Console.ReadLine();
}
}
public class Contact
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }
public string PhoneNumber { get; set; }
public override string ToString()
{
return $"{Id}: {FirstName} {LastName} - {EmailAddress} - {PhoneNumber}";
}
}
public class Book
{
public Guid Id { get; set; }
public string ISBN { get; set; }
public string Title { get; set; }
public string AuthorName { get; set; }
public override string ToString()
{
return $"{Id}: {ISBN} - {Title} by {AuthorName}";
}
}
}