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

  • Home
  • SEARCH
  • 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 7399423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:03:32+00:00 2026-05-29T04:03:32+00:00

I have some code (not writted by me) that I don’t understand: private Func<ControllerContext,

  • 0

I have some code (not writted by me) that I don’t understand:

private Func<ControllerContext, string> ThemeSelector { get; set; }

So this is not a type, this is Func < T, string > and I don’t know how this kind of thing is named but I am unable to find some explanations on Google. Does someone can gives me some explanations of giving me a link to explain?

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-29T04:03:32+00:00Added an answer on May 29, 2026 at 4:03 am

    Func<ControllerContext, string> is a specific type of the generic Func<T,K>.
    You need to learn about generics first before you can fully understand that.

    Therefore ThemeSelector is just a property of that type, which has setter and getter.

    The Func type is a delegate type, which represents a function that takes one parameter of type T and returns an instance of type K.

    This means that you can assign any such function to the property. E.g.:

    private string MyFunction(ControllerContext context) {
        return "Hello world!";
    }
    
    ...
    
    ThemeSelector = MyFunction;
    
    Console.WriteLine(ThemeSelector(null));
    

    will print “Hello world!” in the console.

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

Sidebar

Related Questions

I have some code which I did not originally create that uses _beginthreadex and
I have some code that works fine in FF but not in IE. I
I have some code that compiles and runs on MSVC++ but will not compile
I have some terribly written ASP.NET code that is just not working right (go
I have some code here which works perfectly in firefox but not in chrome
I have some not understanding actions from gnu clisp Suppose, I have some code
I'm not sure if I asked the question correctly. I have some code I
We have a J2EE app built on Struts2+spring+iBatis; not all DAO's use iBatis...some code
I have some code that watches the event log for entry written events and
I have written some code that makes use of an open source library to

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.