Skip to content

Commit 161ed22

Browse files
authored
Update README.md
1 parent de831c7 commit 161ed22

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ TestPropsWithIgnored original = new TestPropsWithIgnored { A = 42, B = "Test val
5252
TestPropsWithIgnored clone = original.DeepClone(); // clone.B is null (default value of a given type)
5353
```
5454

55+
You might also need to exclude certain types from being cloned ever. To do that, put offending types on a blacklist:
56+
```cs
57+
FastCloner.IgnoreType(typeof(PropertyChangedEventHandler)); // or FastCloner.IgnoreTypes([ .. ])
58+
```
59+
60+
If needed, the type can be removed from the blacklist later:
61+
```cs
62+
// note: doing this invalidates precompiled expressions and clears the cache,
63+
// performance will be negatively affected until the cache is repopulated
64+
FastCloner.ClearIgnoredTypes();
65+
```
66+
5567
Apart from deep cloning, FastCloner supports shallow cloning and deep cloning _to_ target:
5668

5769
```csharp

0 commit comments

Comments
 (0)