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

I know this question could be in vain, but it's just out of curiosity,
This is just an out of curiosity question. Let's say you have a database
This is just a question to satisfy my curiosity. But to me it is
This is probably a silly question, but curiosity has gotten the better of me.
I am asking this out of a curiosity. Basically my question is when you
This question would probably apply equally as well to other languages with C-like multi-line
I know there are several questions asking the same question Why should I use
This is something now more of curiosity than actual purpose. If you have a
This question is kind of an add-on to this question In C#, a switch
This question and answer shows how to send a file as a byte array

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.