I noticed that Resharper suggests that I turn this:
if (myObj.myProp is MyType) { ... }
into this:
var myObjRef = myObj.
The best option is use pattern matching like that:
if (value is MyType casted){ //Code with casted as MyType //value is still the same } //Note: casted can be used outside (after) the 'if' scope, too