DeepCopy.Fody
1.0.16-build.35
See the version list below for details.
dotnet add package DeepCopy.Fody --version 1.0.16-build.35
NuGet\Install-Package DeepCopy.Fody -Version 1.0.16-build.35
<PackageReference Include="DeepCopy.Fody" Version="1.0.16-build.35" />
paket add DeepCopy.Fody --version 1.0.16-build.35
#r "nuget: DeepCopy.Fody, 1.0.16-build.35"
// Install DeepCopy.Fody as a Cake Addin #addin nuget:?package=DeepCopy.Fody&version=1.0.16-build.35&prerelease // Install DeepCopy.Fody as a Cake Tool #tool nuget:?package=DeepCopy.Fody&version=1.0.16-build.35&prerelease
This is an add-in for Fody
Generate copy constructors and extension methods to create a new instance with deep copy of properties.
Usage
See Wiki
See also Fody usage.
NuGet installation
Install the DeepCopy.Fody NuGet package and update the Fody NuGet package:
PM> Install-Package Fody
PM> Install-Package DeepCopy.Fody
The Install-Package Fody
is required since NuGet always defaults to the oldest, and most buggy, version of any dependency.
Add to FodyWeavers.xml
Add <DeepCopy/>
to FodyWeavers.xml
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<DeepCopy/>
</Weavers>
Sample
Source at SmokeTest\ReadMeSample.cs
Your Code
public class ReadMeSample
{
public ReadMeSample() { }
[DeepCopyConstructor] public ReadMeSample(ReadMeSample source) { }
public int Integer { get; set; }
public ReadMeEnum Enum { get; set; }
public DateTime DateTime { get; set; }
public string String { get; set; }
public IList<ReadMeSample> List { get; set; }
public IDictionary<ReadMeEnum, ReadMeSample> Dictionary { get; set; }
}
What gets compiled
public class ReadMeSample
{
public ReadMeSample() { }
public ReadMeSample(ReadMeSample source)
{
this.Integer = source.Integer;
this.Enum = source.Enum;
this.DateTime = source.DateTime;
this.String = source.String != null ? new string(source.String.ToCharArray()) : (string)null;
if (source.List != null)
{
IList<ReadMeSample> readMeSampleList = (IList<ReadMeSample>)new System.Collections.Generic.List<ReadMeSample>();
foreach (ReadMeSample source1 in (IEnumerable<ReadMeSample>)source.List)
readMeSampleList.Add(source1 != null ? new ReadMeSample(source1) : (ReadMeSample)null);
this.List = readMeSampleList;
}
if (source.Dictionary == null)
return;
IDictionary<ReadMeEnum, ReadMeSample> dictionary = (IDictionary<ReadMeEnum, ReadMeSample>)new System.Collections.Generic.Dictionary<ReadMeEnum, ReadMeSample>();
foreach (KeyValuePair<ReadMeEnum, ReadMeSample> keyValuePair in (IEnumerable<KeyValuePair<ReadMeEnum, ReadMeSample>>)source.Dictionary)
{
ReadMeEnum key = keyValuePair.Key;
ReadMeSample readMeSample = keyValuePair.Value != null ? new ReadMeSample(keyValuePair.Value) : (ReadMeSample)null;
dictionary[key] = readMeSample;
}
this.Dictionary = dictionary;
}
public int Integer { get; set; }
public ReadMeEnum Enum { get; set; }
public DateTime DateTime { get; set; }
public string String { get; set; }
public IList<ReadMeSample> List { get; set; }
public IDictionary<ReadMeEnum, ReadMeSample> Dictionary { get; set; }
}
Decompiled with JetBrains dotPeek 2021.2.1 Build 212.0.20210826.112035
Icon
Icon copy by projecthayat of The Noun Project
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.16 | 776 | 4/25/2022 |
1.0.16-build.39 | 132 | 4/25/2022 |
1.0.16-build.38 | 129 | 3/29/2022 |
1.0.16-build.37 | 197 | 10/27/2021 |
1.0.16-build.36 | 169 | 10/26/2021 |
1.0.16-build.35 | 149 | 10/24/2021 |
1.0.16-build.34 | 231 | 10/17/2021 |
1.0.16-build.33 | 149 | 10/13/2021 |
1.0.16-build.32 | 157 | 10/9/2021 |
1.0.16-build.31 | 175 | 10/9/2021 |
1.0.16-build.30 | 187 | 10/9/2021 |
1.0.15 | 446 | 10/9/2021 |
1.0.14 | 2,157 | 8/28/2020 |
1.0.12 | 642 | 9/29/2019 |
1.0.11 | 559 | 7/22/2019 |
1.0.10 | 518 | 7/21/2019 |
1.0.9 | 575 | 6/19/2019 |
1.0.8 | 619 | 6/7/2019 |
1.0.7 | 591 | 4/12/2019 |
1.0.6 | 594 | 4/12/2019 |
1.0.5 | 586 | 4/8/2019 |
1.0.4 | 627 | 4/4/2019 |
1.0.3 | 626 | 4/2/2019 |
1.0.2 | 608 | 4/1/2019 |
1.0.1 | 722 | 4/1/2019 |
1.0.0 | 706 | 3/30/2019 |