Skip to main content

UtilityVerse.Copy by pritom purkayasta

NuGet / site data

Nuget GitHub last commit GitHub Repo stars

Details

Info

info

Name: UtilityVerse.Copy

A Roslyn source generator for generating shallow copy and deep copy for class, records and structs

Author: pritom purkayasta

NuGet: https://www.nuget.org/packages/UtilityVerse.Copy/

You can find more details at https://github.com/purkayasta/TheUtilityVerse

Source: https://github.com/purkayasta/TheUtilityVerse

Author

note

pritom purkayasta Alt text

Original Readme

note

The UtilityVerse 🧰

(Multi-verse of utility methods) — a library full of helper methods you might want to use.

Nuget Nuget

⭐️ Give it a star if you like the project!


📦 Packages in This Universe

Use whatever suits your project:

  1. UtilityVerse -> Nuget Nuget 🧰 No dependencies — includes core utility methods.

  2. UtilityVerse.ASPNET -> Nuget Nuget 🌐 ASP.NET Core-specific helpers and extensions.

  3. UtilityVerse.Copy -> Nuget Nuget ✍️ A Roslyn-based source generator that automatically generates ShallowCopy() and DeepCopy() methods for your models.
    → See full details here: UtilityVerse.Copy/README.md


To use this utility library, you may want to start with the Utility class.


Made with ❤️ in C#.

About

note

Deep Clone and Shallow Copy of objects

How to use

Example (source csproj, source files)

This is the CSharp Project that references UtilityVerse.Copy

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UtilityVerse.Copy" Version="0.5.0" />
</ItemGroup>
</Project>

Generated Files

Those are taken from $(BaseIntermediateOutputPath)\GX

using System;

namespace Dolly
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class ClonableAttribute : Attribute
{
}
}

Useful

Download Example (.NET C#)

Share UtilityVerse.Copy

https://ignatandrei.github.io/RSCG_Examples/v2/docs/UtilityVerse.Copy

Category "Clone" has the following generators:

1 CopyTo

2 Dolly

3 UtilityVerse.Copy

See category

Clone