Skip to content
A set of source generators for equality, immutability, ...
C# PowerShell
Branch: master
Clone or download
Latest commit 1c998d7 Nov 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update GitHub templates and added documentation files. Oct 31, 2018
build
doc Updated release notes Jun 18, 2019
src
.editorconfig Fixed missing "global::" for attributes on builder Aug 21, 2018
.gitattributes Initial push Feb 2, 2018
.gitignore Add github PR and issue templates for Uno.CodeGen Oct 29, 2018
.gitpod.yml Should work better with .gitpod at the right place Nov 4, 2019
.vsts-ci.yml Added AzureDevOps build definition Nov 13, 2018
CODE_OF_CONDUCT.md Update GitHub templates and added documentation files. Oct 31, 2018
CONTRIBUTING.md Update GitHub templates and added documentation files. Oct 31, 2018
License.md Initial push Feb 2, 2018
gitversion.yml fixed gitversion Jul 10, 2019
readme.md Remove old stuff from Readme Feb 16, 2019

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

Nuget

NuGet

FAQ

Read our FAQ here

Have questions? Feature requests? Issues?

Make sure to visit our FAQ, StackOverflow, create an issue or visit our gitter.

Contributing

Read our contributing guide to learn about our development process and how to propose bug fixes and improvements.

You can’t perform that action at this time.