RhoMicro.CodeAnalysis.CopyToGenerator
22.0.3
Prefix Reserved
dotnet add package RhoMicro.CodeAnalysis.CopyToGenerator --version 22.0.3
NuGet\Install-Package RhoMicro.CodeAnalysis.CopyToGenerator -Version 22.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RhoMicro.CodeAnalysis.CopyToGenerator" Version="22.0.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RhoMicro.CodeAnalysis.CopyToGenerator" Version="22.0.3" />
<PackageReference Include="RhoMicro.CodeAnalysis.CopyToGenerator"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RhoMicro.CodeAnalysis.CopyToGenerator --version 22.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RhoMicro.CodeAnalysis.CopyToGenerator, 22.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RhoMicro.CodeAnalysis.CopyToGenerator@22.0.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RhoMicro.CodeAnalysis.CopyToGenerator&version=22.0.3
#tool nuget:?package=RhoMicro.CodeAnalysis.CopyToGenerator&version=22.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RhoMicro.CopyTo
This source code generator for C# generates a CopyTo
method for copying the contents of public get
/set
properties from one instance to another.
How To Use
Annotate your type with the GenerateCopyTo
Attribute found in the RhoMicro.CodeAnalysis.CopyToGenerator
namespace:
using RhoMicro.GenerateCopyToGenerator;
[GenerateCopyTo]
partial class MyType
{
public String Prop1 { get; set; }
public Int32 Prop2 { get; set; }
}
The generator will generate a partial implementation like this:
partial class MyType
{
public void CopyTo(MyType target)
{
target.Prop1 = Prop1;
target.Prop2 = Prop2;
}
}
Features And Restrictions
The generator is able to copy:
- other copyable types
- instances of
List<T>
,IEnumerable<T>
,ICollection<T>
,IList<T>
,IReadOnlyCollection<T>
orIReadOnlyList<T>
whose item type is also copyable - using assignment for all other properties
The generator is limited to:
- public read/write properties
- reference types
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.12.0)
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 |
---|---|---|
22.0.3 | 83 | 8/20/2025 |
22.0.2 | 84 | 8/20/2025 |
22.0.1 | 105 | 7/12/2025 |
21.1.2 | 147 | 6/25/2025 |
21.1.0 | 144 | 6/25/2025 |
21.0.6 | 140 | 6/24/2025 |
20.1.5 | 164 | 5/22/2025 |
20.1.4 | 127 | 5/17/2025 |
20.1.2 | 154 | 5/11/2025 |
20.0.0 | 492 | 3/26/2025 |
19.5.0 | 508 | 3/25/2025 |
19.4.0 | 167 | 3/17/2025 |
19.3.0 | 161 | 3/17/2025 |
19.2.0 | 161 | 3/17/2025 |
19.1.0 | 193 | 3/9/2025 |
19.0.2 | 195 | 3/9/2025 |
19.0.1 | 156 | 3/8/2025 |
19.0.0 | 168 | 3/8/2025 |
18.0.3 | 118 | 3/2/2025 |
18.0.2 | 110 | 3/2/2025 |
18.0.1 | 119 | 3/2/2025 |
17.1.3 | 119 | 1/24/2025 |
17.1.2 | 129 | 12/30/2024 |
17.1.1 | 112 | 12/30/2024 |
17.1.0 | 122 | 12/30/2024 |
17.0.2 | 134 | 12/24/2024 |
16.1.2 | 124 | 12/22/2024 |
16.1.1 | 124 | 12/21/2024 |
16.1.0 | 146 | 12/20/2024 |
16.0.4 | 131 | 12/18/2024 |
16.0.3 | 128 | 12/18/2024 |
16.0.0 | 113 | 12/18/2024 |
15.3.4 | 123 | 12/7/2024 |
15.3.3 | 127 | 12/7/2024 |
15.3.2 | 136 | 12/7/2024 |
15.3.1 | 135 | 12/7/2024 |
15.3.0 | 136 | 12/6/2024 |
15.2.4 | 125 | 12/6/2024 |
15.2.3 | 125 | 12/6/2024 |
15.1.7 | 159 | 7/15/2024 |
15.1.6 | 150 | 6/11/2024 |
15.1.5 | 195 | 3/26/2024 |
15.1.4 | 171 | 3/26/2024 |
15.1.3 | 198 | 3/11/2024 |
15.1.2 | 179 | 3/8/2024 |
15.1.1 | 208 | 3/4/2024 |
15.1.0 | 154 | 2/28/2024 |
15.0.1 | 216 | 2/22/2024 |
15.0.0 | 215 | 2/20/2024 |
14.0.5 | 166 | 2/19/2024 |
14.0.4 | 189 | 2/19/2024 |
14.0.3 | 166 | 2/19/2024 |
14.0.2 | 188 | 2/15/2024 |
14.0.0 | 181 | 2/15/2024 |
14.0.0-alpha.30 | 74 | 2/15/2024 |
14.0.0-alpha.29 | 85 | 2/15/2024 |
14.0.0-alpha.28 | 77 | 2/15/2024 |
14.0.0-alpha.27 | 72 | 2/15/2024 |
14.0.0-alpha.26 | 87 | 2/15/2024 |
14.0.0-alpha.25 | 79 | 2/15/2024 |
14.0.0-alpha.24 | 97 | 2/15/2024 |
14.0.0-alpha.22 | 82 | 2/15/2024 |
14.0.0-alpha.20 | 80 | 2/15/2024 |
8.0.3 | 308 | 12/11/2023 |
8.0.2 | 211 | 12/11/2023 |
8.0.0 | 187 | 12/11/2023 |
2.0.0 | 214 | 11/29/2023 |