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 8184001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:21:00+00:00 2026-06-07T01:21:00+00:00

Cannot convert lambda expression to type ‘bool’ because it is not a delegate type

  • 0

Cannot convert lambda expression to type ‘bool’ because it is not a delegate type

When comparing 2 integers in the if statement “if (UserLevelID => dbMinimunlevelID)”

How can I compare a variable that holds a count with another integer?

 //Check if user has enough credits to create ClassCharacter       
        public bool CheckMinimunCreditforClassCharacter(Guid UserID, int ClassCharacterID, int Levelid)
        {

        bool Results = true;

        //Check Character Creation Rules
        int dbMinimunlevelID = 0;
        bool AdditionalCharactersRequired = false;
        int AdditionalCharactersPoints = 0;

        var query = (from o in db.ClassCharacters
                     where o.ClassCharacterID == ClassCharacterID
                     select o);   

        foreach (var v in query)
        {
            dbMinimunlevelID = v.MinimumPoints;
            AdditionalCharactersRequired = v.AdditionalCharactersRequired;
            AdditionalCharactersPoints = v.AdditionalCharactersPoints;
        }

        if (dbMinimunlevelID > 0)
        {
            //Check User existing Characters
            int UserLevelID = db.Characters.Where(o => o.UserId == UserID)
                         .Max(o => o.LevelID);

            //************ Here is where the error appears
            if (UserLevelID => dbMinimunlevelID)
            {
                Results = true;
            }
            else
            {
                Results = false;
            }

        }

        return Results;
    }
  • 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-06-07T01:21:02+00:00Added an answer on June 7, 2026 at 1:21 am

    Replace:

    if (UserLevelID => dbMinimunlevelID)
    

    with:

    if (UserLevelID >= dbMinimunlevelID)
    

    => is lambda operator, whereas >= (greater or equal) is used for comparing

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

Sidebar

Related Questions

The following code throws an compile-time error like Cannot convert type 'string' to 'int'
Can someone please explain why I'm getting this error Type mismatch: cannot convert from
Given this code: List<Integer> ints = new ArrayList<Integer>(); // Type mismatch: // cannot convert
I encountered this error: Cannot implicitly convert type System.Web.UI.WebControls.LoginView to Login The error occured
Exception: Cannot convert the value in attribute 'Text' to object of type 'System.String'. Unable
I cannot convert JS object to exact string, my code: jsonObj['payment_value']=100.10; jsonObj['payment_date']=2012-06-15; jsonObjStr =
The error is cannot convert object to sql parameter I'm working with a bol->dal,
I have faced a problem in Qt with error: cannot convert parameter 1 from
I have often encountered an error such as cannot convert from 'method group' to
I tried many things but I always get cannot convert string to membershipuser from

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.