A set of source generators for equality, immutability, ...
Перейти к файлу
Carl de Billy 30d8c0811f Immutables: static properties were not excluded
from builder generation and were treated as instance properties.
2018-08-23 16:35:21 -04:00
build Fixed CI on AppVeyor 2018-02-27 10:33:46 -05:00
doc Added a FAQ 2018-08-10 13:24:41 -04:00
src Immutables: static properties were not excluded 2018-08-23 16:35:21 -04:00
.appveyor.yml Updates appveyor to whitelist the beta branch. 2018-08-22 15:31:38 -04:00
.editorconfig Fixed missing "global::" for attributes on builder 2018-08-21 16:34:08 -04:00
.gitattributes Initial push 2018-02-02 01:23:14 -05:00
.gitignore Set launchSettings to work on all version of VS 2017 2018-07-23 14:36:17 -04:00
License.md Initial push 2018-02-02 01:23:14 -05:00
gitversion.yml Updates gitversion for beta. 2018-08-22 13:57:07 -04:00
readme.md Added a FAQ 2018-08-10 13:24:41 -04:00

readme.md

Uno CodeGen

Uno.CodeGen is a set of tools to generate C# code in msbuild based projects.

Generate Equality Members for your C# classes

Equality Members generation snippet

Features:

  • Amazingly fast: absolutely zero reflection at runtime
  • Generates both .Equals() and .GetHashCode() overrrides
  • Generates equality (== and !=) operators
  • Implements IEquatable<T>
  • Works with derived classes
  • Custom comparers supported
  • Works with collection members (both same order and unsorted equality)
  • Works with dictionary members (both same order and unsorted equality)
  • Optional case insentive comparisons for strings
  • Optional support for KeyEquality (see doc for more details)
  • Debuggable: You can put a breakpoint directly in the generated code
  • Highly configureable: Generated code provides a lot of useful tips (stripped in previous snippet)
  • Documentation here for Equality Members Generator

Create truly Immutable Entities in C#

Equality Members generation snippet

Features:

  • Automatic Null object pattern generation
  • Automatic generation of <YourClass>.Builder nested class
  • Fluent .With<field/property name>() generation of every members of your class
  • Amazingly fast: absolutely zero reflection at runtime
  • Works with generics & derived classes (even if they are from external assembly)
  • Optional support (on by default) for [GeneratedEquality]
  • Transparent support for Newtonsoft's JSON.NET (activated when detected, can be turned off)
  • Debuggable: You can put a breakpoint directly in the generated code
  • Validation to avoid mutable code in your class
  • Highly configureable: Generated code provides a lot of useful tips (stripped in previous snippet)
  • Documentation here for Immutable Entities Generator

Available Generators

Generator Triggering Attributes Usage
ClassLifecycleGenerator [ConstructorMethod] [DisposeMethod] [FinalizerMethod] Generate code to extend the lifecyle of a class. Documentation
CompilationReferencesListingGenerator none Generate a file without useful code, containing only comments detailing references used to compile the project. Documentation
EqualityGenerator [GenerateEquality] Generate code for efficient .Equals() members generation. Documentation
ImmutableGenerator [GenerateImmutable] Generate code to build truly immutable entities. Documentation
InjectableGenerator [Inject] Generate code to resolve and inject dependencies. Documentation

Continuous Integration Build status

Target Branch Status Recent builds Recommended Nuget packages version
development master Build status Build Stats NuGet
stable stable Build status Build Stats NuGet

FAQ

Read our FAQ here

Release Notes

1.22.0 (May 17th 2018)

  • Added support for System.Guid as a supported immutable type.