removed some new lang features to support net6.0 and net7.0
All checks were successful
.NET Test / test (push) Successful in 1m5s
.NET Publish / publish (push) Successful in 51s

This commit is contained in:
2023-12-15 12:37:39 +04:00
parent c02fdc5492
commit 57e83fbafa
7 changed files with 76 additions and 60 deletions

View File

@@ -60,6 +60,7 @@ public readonly struct Ensure<T>
Value = value;
ValueExpression = valueExpression;
State = ResultState.Success;
Error = default;
}
internal Ensure(Error error, string valueExpression)
@@ -72,7 +73,12 @@ public readonly struct Ensure<T>
}
[Serializable]
public class EnsureNotInitializedException(string variableName = "this") : InvalidOperationException("Ensure was not properly initialized.")
public class EnsureNotInitializedException : InvalidOperationException
{
public string VariableName { get; } = variableName;
public EnsureNotInitializedException(string variableName = "this")
: base("Ensure was not properly initialized.")
{
VariableName = variableName;
}
public string VariableName { get; }
}