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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:08:46+00:00 2026-05-18T03:08:46+00:00

Maybe I am just not reading the MSDN documentation correctly, but given a function

  • 0

Maybe I am just not reading the MSDN documentation correctly, but given a function that takes in one string parameter and returns type T, how can this be specifed as a shared function using Func()?

MSDN says Func(Of In T1, Out TResult), but all of their examples use the same data type, i.e., Func(Of String, String). I want to do Func(Of In String, Out T), where T is arbitrary (but I can constrain it if necessary by a base class). I want it shared/static at the class level, yet the encapsulating class will itself not be a generic class. It seems in this specific scenario, it’s impossible to do what I want because the compiler would have no way of knowing what Type T is at runtime.

So is it possible to do generics on delegates or anonymous lambda expressions in VB.net (not C#)?

  • 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-18T03:08:47+00:00Added an answer on May 18, 2026 at 3:08 am

    It’s not clear exactly what you’re trying to do. You can certainly use generic delegate types within a generic method or type. As a trivial example:

    public T Convert<T>(Func<string, T> converter, string text)
    {
        return converter(text);
    }
    

    However, you can’t do this without T being a type parameter itself, specified either in the generic method or type.

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

Sidebar

Related Questions

Maybe it's just me, but I cannot understand the documentation regarding Junit test integration
What's the best (or maybe not the best -- just good) way for two
Maybe I just don't know .NET well enough yet, but I have yet to
Maybe I'm just thinking about this too hard, but I'm having a problem figuring
Maybe I live in a bubble, or am just too new, but I was
I know this maybe a basic question but I just can't seem to find
HTML (or maybe just XHTML?) is relatively strict when it comes to non-standard attributes
Where is the best place to find information on binding redirects? or maybe just
I've done some Googling, and can't find anything, though maybe I'm just looking in
...just like packages do. I use Emacs (maybe, it can offer some kind of

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.