Skip to content

Commit d89f88b

Browse files
Roman KRoman K
authored andcommitted
Added documentation for 1.1.4
1 parent 0fc675b commit d89f88b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,38 @@ Its also really easy to write a plugin by yourself. I will show you that later.
114114
{
115115
ObjectFiller<Person> pFiller = new ObjectFiller<Person>();
116116
pFiller.Setup()
117-
.IgnoreProperties(p => p.LastName, p => p.Name);
117+
.IgnoreProperties(p => p.LastName, p => p.Age);
118118

119119
Person filledPerson = pFiller.Fill();
120120
}
121121
}
122122
```
123123

124-
With **```IgnoreProperties```** you can exclude properties to not generate random data for it. When we will now fill a person, all properties get filled except **```LastName```** and **```Name```**.
124+
With **```IgnoreProperties```** you can exclude properties to not generate random data for it. When we will now fill a person, all properties get filled except **```LastName```** and **```Age```**.
125+
126+
```csharp
127+
public class Person
128+
{
129+
public string Name { get; set; }
130+
public string LastName { get; set; }
131+
public int Age { get; set; }
132+
public DateTime Birthday { get; set; }
133+
}
134+
135+
public class HelloFiller
136+
{
137+
public void FillPerson()
138+
{
139+
ObjectFiller<Person> pFiller = new ObjectFiller<Person>();
140+
pFiller.Setup()
141+
.IgnoreAllOfType<string>();
142+
143+
Person filledPerson = pFiller.Fill();
144+
}
145+
}
146+
```
147+
148+
With **```IgnoreAllOfType```** you can exclude all properties of a specific type. When we will now fill a person, all properties get filled except **```LastName```** and **```Name```** because they are of type **```string```**.
125149

126150
###Setup Subtypes
127151

0 commit comments

Comments
 (0)