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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:05:38+00:00 2026-06-06T17:05:38+00:00

For some reason this statement is working fine: vms.Where(vm => vm.MessageType == ValidationMessage.EnumValidationMessageType.Warning) But

  • 0

For some reason this statement is working fine:

vms.Where(vm => vm.MessageType == ValidationMessage.EnumValidationMessageType.Warning)

But if at the top of the class, I define an alias (to save space):

using MsgType = ValidationMessage.EnumValidationMessageType;

Then the resulting line of code:

vms.Where(vm => vm.MessageType == MsgType.Warning)

Gives me an error:

enter image description here
“Delegate ‘System.Func<ValidationMessage, int, bool>‘ does not take 1 arguments”. What’s odd about that is that isn’t the Delegate I’m using. I’m using the ‘System.Func<ValidationMessage, bool>‘ overload of .Where<>() – same as when I wasn’t using the alias.

Note that everywhere else the alias is being used works fine, it’s only inside these linq delegates that it breaks. Why is this happening?

  • 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-06T17:05:39+00:00Added an answer on June 6, 2026 at 5:05 pm

    Upon trying to run my program, all those errors cleared away and a single error appeared complaining about my type alias declaration.

    The problem was that the ValidationMessage.EnumValidationMessageType type existed within a namespace, which had been declared further up:

    using WPF.Utilities.ObjectModel;
    using MsgType = ValidationMessage.EnumValidationMessageType;
    

    Of course, C# can’t figure out where the type comes from based on prior namespace inclusions, I had to spell it out fully:

    using WPF.Utilities.ObjectModel;
    using MsgType = WPF.Utilities.ObjectModel.ValidationMessage.EnumValidationMessageType;
    

    Once I did that, the other problem went away.

    I guess I was just so caught up and confounded by the weird errors coming out of the linq statement, combined by the fact that VS didn’t show any errors where I was using the alias in the ternary operators above, that I didn’t see the obvious error there.

    Thanks for the hint nemesv – I should know better than to trust the design-time compiler.

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

Sidebar

Related Questions

This is my mysql statement but for some reason it isn't actually working and
I was working from an example of an 'if' statement, but for some reason
So this is a silly question but for some reason this isn't working for
For some reason this isn't working, am I missing something obvious? RewriteRule ^(.*)infopopup.html$ /acatalog/infopopup.html
For some reason, the if statement below is not working ''# count if records
My JavaScript function is working but for some reason after the alert is displayed
For some reason this line of code is giving me quite a problem. struct
For some reason this () character shows up in Firefox 10 randomly throughout my
For some reason this text isn't being centered. #highlightheader { background-color:#006600; color:white; font-size:30px; text-align:center;
For some reason this program is saying that 'switch' is not defined. What is

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.