Giter Site home page Giter Site logo

deepcopy's Introduction

DeepCopy

Simple & efficient library for deep copying .NET objects

Described in this blog post: https://reubenbond.github.io/posts/codegen-2-il-boogaloo

Installation:

Install via NuGet:

PM> Install-Package DeepCopy

Usage:

// Add a using directive for DeepCopy.
var poco = new Poco();
var original = new[] { poco, poco };

var result = DeepCopier.Copy(original);

// The result is a copy of the original.
Assert.NotSame(original, result);

// Because both elements in the original array point to the same object, 
// both elements in the copied array also point to the same object.
Assert.Same(result[0], result[1]);

Optionally, classes can be marked using the [Immutable] attribute to tell DeepCopy to skip copying them and return them unmodified. Object can also be wrapped in Immutable<T> using Immutable.Create(value).

The majority of this project was adapted from dotnet/orleans.

PR's welcome!

deepcopy's People

Contributors

reubenbond avatar tornhoof avatar tangdf avatar

Watchers

疯风愚雨 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.