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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:19:41+00:00 2026-06-04T13:19:41+00:00

With this code: World w = new World(); var data = GetData<World>(w); If I

  • 0

With this code:

World w = new World();
var data = GetData<World>(w);

If I get w with reflection and this can be of type World, Ambient, Domention, etc.

How can I get GetData ???

I only have the instance object:

var data = GetData<???>(w);
  • 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-04T13:19:43+00:00Added an answer on June 4, 2026 at 1:19 pm
    var type = <The type where GetData method is defined>;
    
    var genericType = typeof(w);
    
    var methodInfo = type.GetMethod("GetData");
    
    var genericMethodInfo = methodInfo.MakeGenericMethod(genericType);
    
    //instance or null : if the class where GetData is defined is static, you can put null : else you need an instance of this class.
    var data = genericMethodInfo.Invoke(<instance or null>, new[]{w});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this code, tableButton = new JButton(new ImageIcon(80F_FG2015.GIF)); how would I get that String
I have run this Perl code: #!/usr/bin/perl print content-type: text/html \n\n; print Hello World.\n;
This is the new code with the update from capdragon, but now it would
I got this code ` // // prints out Hello World! // hello_world(); //First
require 'coderay' puts CodeRay.scan('puts Hello, world!', :ruby).page This code will print full HTML page
I have a C++ DLL with code like this: LogMessage( Hello world ); try
I'm following this tutorial to create a simple Hello World extension for Chrome: http://code.google.com/chrome/extensions/getstarted.html
Can anyone tell me why this code would not be working? $('body').on('test', function() {
How can I make this plugin code accept default options? // Utility if (
I tried this code: $.post('/script', function(result) { var foo = $(result).find('#foo'); $('#result').html(foo); }); Here's

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.