Dynamic object creation and return?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saadkhan
    New Member
    • Aug 2008
    • 40

    Dynamic object creation and return?

    I am in situation where I need to pass some string in a method Examine, that examines which class method (from different namespaces) is suitable to pass that string for processing. Now after processing, each method returns an object of its own type class, in which that particular method exists. My Examine method needs to return such class type of object that will accomodate all returning classes types. That is, Examine method should have a return type which will return every kind of class type object depending on methods return type in it.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Lots of description, but no question.
    What is it you are asking of the volunteers here?

    Comment

    • saadkhan
      New Member
      • Aug 2008
      • 40

      #3
      Sorry if I have confused you. My questions is how can I return different kinds of class objects from same method. Will it involve reflection or delegates for dynamic objects etc....I read this stuff on some other forum.

      Comment

      • cloud255
        Recognized Expert Contributor
        • Jun 2008
        • 427

        #4
        Well everything in .NET inherits form the object class, so you could create a base class from which all your other classes inherit and return that or define the return type as object.

        Comment

        Working...