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 | 172 | 8/20/2025 |
| 22.0.2 | 169 | 8/20/2025 |
| 22.0.1 | 144 | 7/12/2025 |
| 21.1.2 | 181 | 6/25/2025 |
| 21.1.0 | 181 | 6/25/2025 |
| 21.0.6 | 174 | 6/24/2025 |
| 20.1.5 | 218 | 5/22/2025 |
| 20.1.4 | 163 | 5/17/2025 |
| 20.1.2 | 189 | 5/11/2025 |
| 20.0.0 | 530 | 3/26/2025 |
| 19.5.0 | 555 | 3/25/2025 |
| 19.4.0 | 217 | 3/17/2025 |
| 19.3.0 | 200 | 3/17/2025 |
| 19.2.0 | 198 | 3/17/2025 |
| 19.1.0 | 227 | 3/9/2025 |
| 19.0.2 | 250 | 3/9/2025 |
| 19.0.1 | 209 | 3/8/2025 |
| 19.0.0 | 207 | 3/8/2025 |
| 18.0.3 | 152 | 3/2/2025 |
| 18.0.2 | 144 | 3/2/2025 |
| 18.0.1 | 150 | 3/2/2025 |
| 17.1.3 | 151 | 1/24/2025 |
| 17.1.2 | 163 | 12/30/2024 |
| 17.1.1 | 144 | 12/30/2024 |
| 17.1.0 | 155 | 12/30/2024 |
| 17.0.2 | 178 | 12/24/2024 |
| 16.1.2 | 170 | 12/22/2024 |
| 16.1.1 | 158 | 12/21/2024 |
| 16.1.0 | 193 | 12/20/2024 |
| 16.0.4 | 181 | 12/18/2024 |
| 16.0.3 | 160 | 12/18/2024 |
| 16.0.0 | 146 | 12/18/2024 |
| 15.3.4 | 157 | 12/7/2024 |
| 15.3.3 | 161 | 12/7/2024 |
| 15.3.2 | 183 | 12/7/2024 |
| 15.3.1 | 168 | 12/7/2024 |
| 15.3.0 | 168 | 12/6/2024 |
| 15.2.4 | 163 | 12/6/2024 |
| 15.2.3 | 156 | 12/6/2024 |
| 15.1.7 | 191 | 7/15/2024 |
| 15.1.6 | 198 | 6/11/2024 |
| 15.1.5 | 226 | 3/26/2024 |
| 15.1.4 | 201 | 3/26/2024 |
| 15.1.3 | 249 | 3/11/2024 |
| 15.1.2 | 222 | 3/8/2024 |
| 15.1.1 | 243 | 3/4/2024 |
| 15.1.0 | 185 | 2/28/2024 |
| 15.0.1 | 264 | 2/22/2024 |
| 15.0.0 | 245 | 2/20/2024 |
| 14.0.5 | 198 | 2/19/2024 |
| 14.0.4 | 223 | 2/19/2024 |
| 14.0.3 | 199 | 2/19/2024 |
| 14.0.2 | 222 | 2/15/2024 |
| 14.0.0 | 213 | 2/15/2024 |
| 14.0.0-alpha.30 | 80 | 2/15/2024 |
| 14.0.0-alpha.29 | 106 | 2/15/2024 |
| 14.0.0-alpha.28 | 98 | 2/15/2024 |
| 14.0.0-alpha.27 | 77 | 2/15/2024 |
| 14.0.0-alpha.26 | 93 | 2/15/2024 |
| 14.0.0-alpha.25 | 84 | 2/15/2024 |
| 14.0.0-alpha.24 | 103 | 2/15/2024 |
| 14.0.0-alpha.22 | 90 | 2/15/2024 |
| 14.0.0-alpha.20 | 84 | 2/15/2024 |
| 8.0.3 | 340 | 12/11/2023 |
| 8.0.2 | 243 | 12/11/2023 |
| 8.0.0 | 218 | 12/11/2023 |
| 2.0.0 | 264 | 11/29/2023 |