pauldeen79.CrossCutting.ProcessingPipeline
9.0.8
dotnet add package pauldeen79.CrossCutting.ProcessingPipeline --version 9.0.8
NuGet\Install-Package pauldeen79.CrossCutting.ProcessingPipeline -Version 9.0.8
<PackageReference Include="pauldeen79.CrossCutting.ProcessingPipeline" Version="9.0.8" />
<PackageVersion Include="pauldeen79.CrossCutting.ProcessingPipeline" Version="9.0.8" />
<PackageReference Include="pauldeen79.CrossCutting.ProcessingPipeline" />
paket add pauldeen79.CrossCutting.ProcessingPipeline --version 9.0.8
#r "nuget: pauldeen79.CrossCutting.ProcessingPipeline, 9.0.8"
#addin nuget:?package=pauldeen79.CrossCutting.ProcessingPipeline&version=9.0.8
#tool nuget:?package=pauldeen79.CrossCutting.ProcessingPipeline&version=9.0.8
CrossCutting
Generic utilities and other stuff, usable in any layer of any solution. We're targeting .NET Standard 2.0, so you can even use .NET Framework 4.x if you want to.
This repository consists of the following packages:
Package name | Description |
---|---|
CrossCutting.Common | Provider for system date and user name, some useful extension methods on System.Object and System.String, and the Result class |
CrossCutting.Common.Testing | Helps you test constructors on null checks |
CrossCutting.Data.Abstractions | Abstraction for executing database commands using System.Data namespace (IDbConnection and IDbCommand) |
CrossCutting.Data.Core | Default implementation of database commands |
CrossCutting.Data.Sql | Extension methods for working with database commands in System.Data namespace (IDbConnection) |
CrossCutting.DataTableDumper | Produces flat-text data tables from objects |
CrossCutting.Utilities.ObjectDumper | Produces readable flat-text representation from objects, for use in logging |
CrossCutting.Utilities.Parsers | Parsers for pipe-delmited data table strings, TSQL INSERT INTO statements, expression strings, function strings, math expressions and formattable strings (dynamic interpolated strings) |
CrossCutting.Utilities.ExpressionEvaluator | Expression evaluator to dynamically evaluate strings, with support for all kinds of stuff, like: operators, functions, mathematic expressions, and so on |
System.Data.Stub | Stubs for System.Data interfaces like IDbConnection, IDbCommand and IDataReader |
Using NSubstitute or Moq as mock factory for CrossCutting.Common.Testing
To use NSubstitute as a mock factory for the code in CrossCutting.Common.Testing, create a test helper project within your solution, and add the following code:
public static void ShouldThrowArgumentNullExceptionsInConstructorsOnNullArguments(
this Type type,
Func<ParameterInfo, bool>? parameterPredicate = null,
Func<ParameterInfo, object?>? parameterReplaceDelegate = null,
Func<ConstructorInfo, bool>? constructorPredicate = null)
=> ShouldThrowArgumentNullExceptionsInConstructorsOnNullArguments(
type,
t => t.CreateInstance(parameterType => Substitute.For(new[] { parameterType }, Array.Empty<object>()), parameterReplaceDelegate, constructorPredicate),
parameterPredicate,
parameterReplaceDelegate,
constructorPredicate);
You can easily replace NSubstitute with Moq, if you want, by changing the factory delegate argument to this:
t => t.CreateInstance(parameterType => ((Mock)Activator.CreateInstance(typeof(Mock<>).MakeGenericType(parameterType))).Object, parameterReplaceDelegate, constructorPredicate),
Upgrade from 2.x to 3.0
There has been a breaking change in the Result class, which lead to a new major version. To port the old code, you can fix most errors by replace this:
Result<([^>]+)>\.([^(]+)\(
With this:
Result.$2<$1>(
Upgrade Parsers from 6.x to 7.0
There have been some breaking changes.
- FunctionParseResult has been renamed to FunctionCall, because that's what it is.
- IFunctionResultParser has been renamed to IFunction, and Parse has been renamed to Evaluate, because that's what it is.
- IPlaceholderProcessor has been renamed to IPlaceholder, and Process has been renamed to Evaluate, because that's what it is.
- Some parsers and evaluators now have a Validate method, to check whether the input is valid. This way, you can check validity without actually performing the action.
- IVariable and IVariableProcessor now have a method called Evaluate instead of Process, which is more descriptive.
- IExpressionParser has been renamed to IExpressionEvaluator and IExpressionParserProcessor to IExpression.
- IExpressionStringParser has been renamed to IExpressionStringEvaluator and IExpresionStringParserProcessor to IExpressionString.
- IMathematicExpressionParser has been renamed to IMathematicExpressionEvaluator and IMathematicExpressionProcessor to IMathematicExpression.
- FormattableStringParserResult has been renamed to GenericFormattableString.
ExpressionEvaluator
The ExpressionEvaluator is a complete rewrite of the Parsers project, where and Expression is the entry type for everything. An expression can contain the following things:
- Strings, like "hello world"
- Interpolated strings, like "hello {name}"
- Booleans "true" and "false"
- Constructors like "new DateTime(2025, 1 ,1)"
- DateTime.Now and DateTime.Today, as well as the Date and DateTime functions to create a custom DateTime value
- Numeric values, both integer and floating point types like "1.3" and "12"
- Mathematic operators like +, -, * and /, including brackets, for example "(1 + 1) * 13"
- Binary operators && and || for example "true && true"
- Unary operator ! to inverse a boolean value like "!true"
- Comparison operators <, ⇐, >, >=, == and != for example "true != false"
- Indexers like MyArray[1]
- Built-in methods for DateTime values: AddDays, AddHours, AddMinuts, AddMonths, AddSeconds and AddYears
- Built-in functions for String values: Left, Right, Mid
- Built-in methods for String values: ToCamelCase, ToLower, ToPascalCase and ToUpper
- Cast and Convert functions to cast and convert values to other types
- Coalesce function, to get the first value that is not null
- ToString method to convert objects to string
- IsNull function to check for null values
- Optional support for reflection to get property values or invoke methods
- Type-safe properties, without reflection: Array.Length, String.Length, ICollection.Count, and Year/Month/Day/Hour/Minute/Second/Date for DateTime
- Support for context using delegates, in order to allow lazy evaluation
- Support for adding custom functions and generic functions, using dependency injection
- Support for adding custom expression components, using dependency injection
- Support for adding custom instance methods, constructors and properties, using dependency injection
Design decisions:
- Extendable through Dependency Injection
- Result-based, exception free. When an exception occurs, just check the Status property of the result, and you can see the details using the Exception property if you want
- Free of reflection by default, but you can enable it
- Allow duck-typing for properties and methods, with or without reflection
- Without reflection, you have to write DotExpressionComponents to implement the members
- Basic support for discoverability and validation, using a Parse method. This will return the status (Ok/Invalid) and the return type of the expression, as well as some details like the inner results, and the type that handles this expression
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- pauldeen79.CrossCutting.Common (>= 3.23.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on pauldeen79.CrossCutting.ProcessingPipeline:
Package | Downloads |
---|---|
pauldeen79.ClassFramework.Pipelines
Package Description |
|
DatabaseFramework.TemplateFramework
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.0.8 | 28 | 5/18/2025 |
9.0.7 | 132 | 5/5/2025 |
9.0.6 | 158 | 3/22/2025 |
9.0.5 | 793 | 3/16/2025 |
9.0.4 | 243 | 3/9/2025 |
9.0.3 | 260 | 3/2/2025 |
9.0.2 | 380 | 2/8/2025 |
9.0.1 | 450 | 1/19/2025 |
9.0.0 | 89 | 1/17/2025 |
8.2.5 | 87 | 1/16/2025 |
8.2.4 | 101 | 1/12/2025 |
8.2.3 | 1,781 | 10/29/2024 |
8.2.2 | 412 | 9/21/2024 |
8.2.1 | 239 | 9/11/2024 |
8.2.0 | 414 | 7/11/2024 |
8.1.3 | 1,005 | 5/9/2024 |
8.1.1 | 394 | 5/3/2024 |
8.1.0 | 325 | 4/27/2024 |
8.0.0 | 134 | 4/26/2024 |
7.0.0 | 279 | 4/19/2024 |
6.0.0 | 229 | 4/16/2024 |
5.0.1 | 493 | 4/6/2024 |
5.0.0 | 128 | 4/5/2024 |
4.4.0 | 811 | 3/22/2024 |
4.3.0 | 125 | 3/21/2024 |
4.2.0 | 346 | 3/15/2024 |
4.1.0 | 374 | 3/14/2024 |
4.0.2 | 914 | 12/18/2023 |
4.0.0 | 159 | 12/18/2023 |
3.3.0 | 259 | 11/24/2023 |
3.1.0 | 242 | 10/24/2023 |
3.0.0 | 153 | 10/21/2023 |
2.14.1 | 208 | 10/11/2023 |
2.14.0 | 148 | 10/11/2023 |
2.13.0 | 167 | 10/8/2023 |
2.12.0 | 166 | 10/6/2023 |
2.11.0 | 214 | 9/26/2023 |
2.10.0 | 138 | 9/18/2023 |