Cheatography
https://cheatography.com
toolkit funktions, windowspath, exceptions etc
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Errors
private string? Value
{
get => this._myClass?
.Value;
set
{
_ = this._myClass
?? Errors
.UnableToAssignValue()
this._myClass.Value = value;
}
}
|
Property Wertübergabe, Errors wirft Exception
|
|
|
ThrowIf
value.ThrowIf();
//Bsp
value.ThrowIfNotDirectoryPath();
value.ThrowIfNullOrWhitespace;
//usw.
|
Je nach Datentyp unterschiedliche ThrowIf-Methoden. Erleichtert Exception Throwing
|
|
windowspath (copy)
Console.Writeline("Hello World!");
|
Preconditions
public string Value {get;}
=Preconditions.CheckIfNull(value)
|
Übergeben von Konstruktorparametern nach Null-Check ggf. an Propertiers
|