RhoMicro.CodeAnalysis.CopyToGenerator
14.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package RhoMicro.CodeAnalysis.CopyToGenerator --version 14.0.0
NuGet\Install-Package RhoMicro.CodeAnalysis.CopyToGenerator -Version 14.0.0
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="14.0.0"> <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.
paket add RhoMicro.CodeAnalysis.CopyToGenerator --version 14.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RhoMicro.CodeAnalysis.CopyToGenerator, 14.0.0"
#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.
// Install RhoMicro.CodeAnalysis.CopyToGenerator as a Cake Addin #addin nuget:?package=RhoMicro.CodeAnalysis.CopyToGenerator&version=14.0.0 // Install RhoMicro.CodeAnalysis.CopyToGenerator as a Cake Tool #tool nuget:?package=RhoMicro.CodeAnalysis.CopyToGenerator&version=14.0.0
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 (>= 4.8.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 |
---|---|---|
15.1.7 | 106 | 7/15/2024 |
15.1.6 | 93 | 6/11/2024 |
15.1.5 | 158 | 3/26/2024 |
15.1.4 | 134 | 3/26/2024 |
15.1.3 | 150 | 3/11/2024 |
15.1.2 | 133 | 3/8/2024 |
15.1.1 | 169 | 3/4/2024 |
15.1.0 | 121 | 2/28/2024 |
15.0.1 | 165 | 2/22/2024 |
15.0.0 | 162 | 2/20/2024 |
14.0.5 | 125 | 2/19/2024 |
14.0.4 | 147 | 2/19/2024 |
14.0.3 | 126 | 2/19/2024 |
14.0.2 | 147 | 2/15/2024 |
14.0.0 | 137 | 2/15/2024 |
14.0.0-alpha.30 | 51 | 2/15/2024 |
14.0.0-alpha.29 | 49 | 2/15/2024 |
14.0.0-alpha.28 | 51 | 2/15/2024 |
14.0.0-alpha.27 | 49 | 2/15/2024 |
14.0.0-alpha.26 | 56 | 2/15/2024 |
14.0.0-alpha.25 | 51 | 2/15/2024 |
14.0.0-alpha.24 | 49 | 2/15/2024 |
14.0.0-alpha.22 | 51 | 2/15/2024 |
14.0.0-alpha.20 | 53 | 2/15/2024 |
8.0.3 | 276 | 12/11/2023 |
8.0.2 | 178 | 12/11/2023 |
8.0.0 | 154 | 12/11/2023 |
2.0.0 | 177 | 11/29/2023 |