I have this statement (which works):
x => x is View v && (x as View).IsTemplate
where the IsTemplate property only exists on the derived type View
I would like to shorten it to:
x => x is View v & v.IsTemplate
But I cant, I get the error "use of unassigned local variable". Eventhough intellisense gives me the IsTemplate property. Is this impossible, or did I miss something in the syntax? It looks much nicer and I cant see any logic issues with it.