LoDaTek.Cloneable.Core
3.0.2405.143
dotnet add package LoDaTek.Cloneable.Core --version 3.0.2405.143
NuGet\Install-Package LoDaTek.Cloneable.Core -Version 3.0.2405.143
<PackageReference Include="LoDaTek.Cloneable.Core" Version="3.0.2405.143" />
paket add LoDaTek.Cloneable.Core --version 3.0.2405.143
#r "nuget: LoDaTek.Cloneable.Core, 3.0.2405.143"
// Install LoDaTek.Cloneable.Core as a Cake Addin #addin nuget:?package=LoDaTek.Cloneable.Core&version=3.0.2405.143 // Install LoDaTek.Cloneable.Core as a Cake Tool #tool nuget:?package=LoDaTek.Cloneable.Core&version=3.0.2405.143
Cloneable
This is a fork of https://github.com/Nickztar/Cloneable which is a fork of https://github.com/mostmand/Cloneable - Which doesn't seem to be maintained...
Auto generate Clone method using C# Source Generator
There are times you want to make a clone of an object. You can implement a clone method, but when a developer adds a new Field or Property the clone method should be changed too. Another way is to use reflection which is not performant. This source generator saves your time by generating the boilerplate code for cloning an object.
Installing Cloneable
You should install Cloneable with NuGet:
Install-Package LoDaTek.Cloneable
Or via the .NET Core command line interface:
dotnet add package LoDaTek.Cloneable
Either commands, from Package Manager Console or .NET Core CLI, will download and install Cloneable and all required dependencies.
Usage
You can add clone method to a class by making it partial and adding the attribute Cloneable
on top of it. An example is provided in Cloneable.Sample project.
Source generators are introduced in dotnet 5.0. So make sure to have Visual Studio 16.8 or dotnet 5.0 sdk installed.
Here is a simple example:
using LoDaTek.Cloneable.Core;
[Cloneable]
public partial class Foo
{
public string A { get; set; }
public int B { get; set; }
}
For more examples please visit the sample project. Or view some of the tests test 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 | 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. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LoDaTek.Cloneable.Core:
Package | Downloads |
---|---|
LoDaTek.Cloneable
Auto-generator of Clone method using C# Source Generator |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.2405.143 | 383 | 5/24/2024 |
3.0.2405.141 | 165 | 5/14/2024 |