C
C#10mo ago
robs0271

Undestand the "0" value on creation of an entity instance

Hi, I am trying to understand what the "0" stands for here, when a new instance of the entity FilterExpression is created: FilterExpression filterExpression = new FilterExpression((LogicalOperator) 0); As I undesrtand, the following constructor of the class *FilterExpression *is used: FilterExpression(LogicalOperator) But why a "0" is added inside the () ?
No description
No description
No description
3 Replies
Pobiega
Pobiega10mo ago
(LogicalOperator)0 is the value being passed to the constructor thats a 0 cast as a LogicalOperator. Is LogicalOperator perhaps an enum?
robs0271
robs0271OP10mo ago
@Pobiega Thank you so much for the hint! Yes, after your comment I saw in the Microsoft documentation that it is an enum and "0" stands for AND
No description
Pobiega
Pobiega10mo ago
An easier and more idiomatic way to write this would be... LogicalOperator.And
Want results from more Discord servers?
Add your server