From 11cf35b0f91bfb1eb2ccde4668f1ccc942e11e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20=C5=A0t=C3=A1gl?= Date: Thu, 23 Jan 2025 09:21:12 +0100 Subject: [PATCH] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 53316ca..b8589c4 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,15 @@ using FastCloner.Code; var clone = FastCloner.DeepClone(new { Hello = "world", MyList = new List { 1 } }); ``` -⭐ **That's it!** _Feel free to map this method to your extension so if you need to migrate in the future it's a matter of just switching that method. We intentionally don't ship our own `.DeepClone()` extension method._ +⭐ **That's it!** _Feel free to map this method to your extension so if you need to migrate in the future it's a matter of just switching that method. We intentionally don't ship our own `.DeepClone()` extension method. If you don't have one yet, just copy this into your project:_ + +```cs +[return: NotNullIfNotNull(nameof(obj))] +public static T? DeepClone(this T? obj) +{ + return FastCloner.FastCloner.DeepClone(obj); +} +``` ## Advanced usage