RhoMicro.CodeAnalysis.CopyToGenerator
20.1.4
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 20.1.4
NuGet\Install-Package RhoMicro.CodeAnalysis.CopyToGenerator -Version 20.1.4
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="20.1.4"> <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="20.1.4" />
<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 20.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RhoMicro.CodeAnalysis.CopyToGenerator, 20.1.4"
#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.
#addin nuget:?package=RhoMicro.CodeAnalysis.CopyToGenerator&version=20.1.4
#tool nuget:?package=RhoMicro.CodeAnalysis.CopyToGenerator&version=20.1.4
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 |
---|---|---|
20.1.5 | 133 | 13 days ago |
20.1.4 | 105 | 18 days ago |
20.1.2 | 130 | 24 days ago |
20.0.0 | 475 | 2 months ago |
19.5.0 | 488 | 2 months ago |
19.4.0 | 147 | 3 months ago |
19.3.0 | 149 | 3 months ago |
19.2.0 | 148 | 3 months ago |
19.1.0 | 175 | 3 months ago |
19.0.2 | 169 | 3 months ago |
19.0.1 | 133 | 3 months ago |
19.0.0 | 151 | 3 months ago |
18.0.3 | 100 | 3 months ago |
18.0.2 | 98 | 3 months ago |
18.0.1 | 103 | 3 months ago |
17.1.3 | 103 | 4 months ago |
17.1.2 | 110 | 5 months ago |
17.1.1 | 96 | 5 months ago |
17.1.0 | 109 | 5 months ago |
17.0.2 | 105 | 5 months ago |
16.1.2 | 102 | 5 months ago |
16.1.1 | 106 | 5 months ago |
16.1.0 | 119 | 5 months ago |
16.0.4 | 106 | 6 months ago |
16.0.3 | 112 | 6 months ago |
16.0.0 | 99 | 6 months ago |
15.3.4 | 105 | 6 months ago |
15.3.3 | 111 | 6 months ago |
15.3.2 | 112 | 6 months ago |
15.3.1 | 121 | 6 months ago |
15.3.0 | 124 | 6 months ago |
15.2.4 | 111 | 6 months ago |
15.2.3 | 112 | 6 months ago |
15.1.7 | 143 | 7/15/2024 |
15.1.6 | 119 | 6/11/2024 |
15.1.5 | 182 | 3/26/2024 |
15.1.4 | 159 | 3/26/2024 |
15.1.3 | 175 | 3/11/2024 |
15.1.2 | 160 | 3/8/2024 |
15.1.1 | 196 | 3/4/2024 |
15.1.0 | 142 | 2/28/2024 |
15.0.1 | 193 | 2/22/2024 |
15.0.0 | 204 | 2/20/2024 |
14.0.5 | 153 | 2/19/2024 |
14.0.4 | 175 | 2/19/2024 |
14.0.3 | 154 | 2/19/2024 |
14.0.2 | 175 | 2/15/2024 |
14.0.0 | 165 | 2/15/2024 |
14.0.0-alpha.30 | 66 | 2/15/2024 |
14.0.0-alpha.29 | 65 | 2/15/2024 |
14.0.0-alpha.28 | 65 | 2/15/2024 |
14.0.0-alpha.27 | 63 | 2/15/2024 |
14.0.0-alpha.26 | 75 | 2/15/2024 |
14.0.0-alpha.25 | 67 | 2/15/2024 |
14.0.0-alpha.24 | 78 | 2/15/2024 |
14.0.0-alpha.22 | 69 | 2/15/2024 |
14.0.0-alpha.20 | 71 | 2/15/2024 |
8.0.3 | 297 | 12/11/2023 |
8.0.2 | 199 | 12/11/2023 |
8.0.0 | 177 | 12/11/2023 |
2.0.0 | 199 | 11/29/2023 |