Can this be done in a better way?
public bool AreMoreNeeded() => EntitiesNeededCount == 0 ? true : false;
I am using this to check if an integer
is 0 and return a boolean
based on the operation result .
yes, remove the true
and false
:
public bool AreMoreNeeded() => EntitiesNeededCount == 0;
the equality operator :
The equality operator
==
returnstrue
if its operands are equal,false
otherwise.
EDIT:
You can make it even a little more shorter and make it a property instead of a method:
public bool AreMoreNeeded => EntitiesNeededCount == 0;