Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RecSharp

RecSharp is an immutable record generator for .NET Immutable records are similiar to F#'s records or Scala's case classes, but can be used from C# safely.

Here is the sample record definition (You can found it in sample.rcs)

namespace Records {
    using System;

    record Test {
        Int32 Id;
        String Name;
		Nullable<Decimal> Amount;
    }
}

Generater class Test will have:

  • getter-only properties
  • constructor with parameters for properties initialization
  • Copy() method with optional parameters
  • IEquatable implementation
  • overrides os Equals() and GetHashCode()
  • == and != operators

External libraries can be referenced by command-line parameter or by the following syntax (which if useful for VS extension):

#ref System.Linq.dll;

Compile it with RecSharpC -i sample.rcs -o Records.dll and reference Records.dll to Your project. That's it!

About

Immutable record generator for .NET

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages