Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2012 [RESOLVED] Trouble with Func(TResult).

$
0
0
Ok, bear with me on this one. I am sure I am just messing up something very simple.

I have this declared:
vb.net Code:
  1. Property CheckStateCondition As Func(Of Boolean)

Then, I use it like so:
vb.net Code:
  1. If CheckStateCondition Then
  2. ' Do something
  3. End If

There is an error on CheckStateCondition that says,
Quote:

Value of type 'System.Func(Of Boolean)' cannot be converted to 'Boolean'.
I have tried Google, where every link says I am declaring it correctly. I tried searching for the error message itself and got nothing useful. I even tried using Predicate(T) and got the same result. All I am trying to do is store a Boolean value from a lambda.

Thanks.

Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>