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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:47:59+00:00 2026-05-11T10:47:59+00:00

I have the System.Type of a certain object but need to pass that over

  • 0

I have the System.Type of a certain object but need to pass that over as a Type Parameter T to another method… is that somehow possible? Or am I lost in the bigger picture there?

  • 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. 2026-05-11T10:48:00+00:00Added an answer on May 11, 2026 at 10:48 am

    This is not possible. If you think about it, a Type Parameter is resolved at compile time, whereas the System.Type is resolved by reflection at runtime.

    Now, having said it’s impossible, it is possible by using reflection. If you create the class with reflection you can pass in a System.Type as a parameter, but it’s probably just worth redesigning whatever it is you’re trying to do.

    EDIT: Here’s some ideas for a redesign.

    Where does the System.Type come from? Could you pass it in as a type parameter itself so it can be passed through?

    If not, could you make an adapter that handles the known types that will be used? Perhaps a switch statement that converts from the System.Type to the right sort of generic call? Anything is faster than reflection.

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

Sidebar

Ask A Question

Stats

  • Questions 68k
  • Answers 68k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Try execute the following or put in into your .vimrc… May 11, 2026 at 12:06 pm
  • added an answer You can do that using reflection. PropertyInfo prop = typeof(Customer).GetProperty… May 11, 2026 at 12:06 pm
  • added an answer To make LIKE Statements, you can use the Contains method:… May 11, 2026 at 12:06 pm

Related Questions

I have an object of the type System.Drawing.Image and want to make every pixel
I have the following code: using System; using System.Linq; using System.Linq.Expressions; public class Program
I have the following code: if (System.IO.File.Exists(htmlLocation)) { vEarthBrowser.ObjectForScripting = this; vEarthBrowser.Url = new
I have the following string in the smarty (php templating system) variable $test: <img
I have the following code in Visual Studio 2005. Dim OutFile As System.IO.StreamWriter Try
I have a NotifyIcon control that appears in the system tray. How can I
I have the following structure public class MyClass : MyBaseClass<System.Int32> { } In a
I have the following in my web.config: <location path=RestrictedPage.aspx> <system.web> <authorization> <allow roles=Group1Admin, Group3Admin,
I have an Electronic Workforce (EWF) application that records the caller speaking. The system
Say I have the following web.config: <?xml version=1.0 encoding=utf-8?> <configuration> <system.web> <authentication mode=Windows></authentication> </system.web>

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.