C
C#11mo ago
SWEETPONY

✅ why ArgumentException.ThrowIfNullOrEmpty(); is only for string?

I have following:
public class A
{
A(AnotherClass AC)
{
// how to check AC for null?
var vc = new Test(AC);
}
}
public class A
{
A(AnotherClass AC)
{
// how to check AC for null?
var vc = new Test(AC);
}
}
7 Replies
SWEETPONY
SWEETPONYOP11mo ago
I don't want to use if(AC==null)
Pobiega
Pobiega11mo ago
No description
Angius
Angius11mo ago
Because only a string can be "empty"
Pobiega
Pobiega11mo ago
NullOrEmpty is only really a thing for strings
SWEETPONY
SWEETPONYOP11mo ago
ArgumentNullException.ThrowIfNull?
Pobiega
Pobiega11mo ago
ye
SWEETPONY
SWEETPONYOP11mo ago
ah okey thanks
Want results from more Discord servers?
Add your server