Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 594683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:58:48+00:00 2026-05-13T15:58:48+00:00

This is a question for my curiosity really, as i know there are other

  • 0

This is a question for my curiosity really, as i know there are other ways to work around the problem.

I have a property on my “Item” class – “MyProperty” – that I want to evaluate. I want to iterate through the collection – “MyItemCollection” – , and if there is an “Item” class whos property “MyProperty” is not nothing i want to set a Boolean flag to indicate that the collection contains a non null MyProperty on any of its “Item” Objects.

Private ContainsPOF = Function() (From thisItem As Item In MyItemCollection Where Item.MyProperty IsNot Nothing Select item).Count > 0

This gives me a warning of “Variable decleration without an ‘As’ clause; type of Object assumed”, so i tried

Private ContainsPOF As Boolean = Function() (From thisItem As Item In MyItemCollection Where Item.MyProperty IsNot Nothing Select item).Count > 0 subc).Count > 0

This however gives me the error of “Lamda expression cannot be converted to ‘Boolean’ As ‘Boolean’ is not a delegate type”

Is there anyway to make the return of this Function type safe, or should I just use a different method (an old style Function)?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:58:49+00:00Added an answer on May 13, 2026 at 3:58 pm

    I think you want to declare it as Func(Of Boolean) instead:

    Private ContainsPOF As Func(Of Boolean) = [...]
    

    As far as I can see that’s not creating a property (as per your first paragraph) though. Why not declare it as a normal property?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's really no pressing reason for me to ask this question other than curiosity
This question is pure curiosity. In Xcode, why does this work: if (view.class ==
This question is out of curiosity. Is there a difference between: public abstract class
This question is for pure curiosity. Lets say I have lighttpd installed on my
This question might not seem very technical but, out of curiosity,I want to know
This is just a curiosity question. I know that Spring can be used in
I know this question could be in vain, but it's just out of curiosity,
This question really is kinda pointless, but I'm just curious: This: public sealed class
This is a really basic question really just to satisfy my curiosity, but is
I ask this question out of sheer curiosity. I don't have any actual code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.