Moreland.CSharp.Util

Common Infrastructure classes


Keywords
CQS, CQRS, Utility, Optional, Extension, csharp, maybe
License
MIT
Install
Install-Package Moreland.CSharp.Util -Version 2.2.0

Documentation

Trunk CI Build

Moreland.CSharp.Util

Utilty object library provided generic support types such as results, optionals, etc.. for use in other software packages

Result Types

3 result types: QueryResult<T>, CommandResult, and CommandAndQueryResult<T>; CommandAndQueryResult<T> violates CQS but is provided because while command query seperation should be strived for it's not always possible with given code.

Support Classes

  • Maybe<T> a C# equivalent of java.util.Optional
  • NumericParser, class providing MaybeParse...() methods with the same similar
  • HashCodeBuilder; builder which creates a HashCode for multiple values, similar to HasCode.Combine<T1>(T1 value) available in newer versions of .NET (dotnet standard 2.1+)

Acknowledgements

Either class initially based primarily on examples given during Marking Functional C# by Zoran Horvat