Discussion Forum : reflection

How to get the assembly (System.Reflection.Assembly) for a given type in .Net?
In .Net, given a type name, is there a method that tells me in which assembly (instance of System.Reflection.Assembly) t ... View Detail
 Upvotes: 0   Answers: 0
Using reflection in C# to get properties of a nested object
Given the following objects: public class Customer {  public String Name { get; set; }  public String Address { get; se ... View Detail
 Upvotes: 0   Answers: 0
C# Reflection - Get field values from a simple class
I have a class: class A {  public string a = A-val , b = B-val; }  I want to print the object members by reflection ... View Detail
 Upvotes: 0   Answers: 0
How can you loop over the properties of a class?
Is there a way in c# to loop over the properties of a class? Basically I have a class that contains a large number of p ... View Detail
 Upvotes: 0   Answers: 0
How to call generic method with a given Type object?
I want to call my generic method with a given type object. void Foo(Type t) {   MyGenericMethod<t>(); }  obviously doe ... View Detail
 Upvotes: 0   Answers: 0
EntityFramework Get object by ID?
Is it possible with Generics to get an object from my EntityFramework without knowing the type? I'm thinking of somethi ... View Detail
 Upvotes: 0   Answers: 0
Convert.ChangeType() fails on Nullable Types
I want to convert a string to an object property value, whose name I have as a string. I am trying to do this like so: ... View Detail
 Upvotes: 0   Answers: 0
Using the Web Application version number from an assembly (ASP.NET/C#)
How do I obtain the version number of the calling web application in a referenced assembly? I've tried using System.Ref ... View Detail
 Upvotes: 0   Answers: 0
How do I check if a property exists on a dynamic anonymous type in c#?
I have an anonymous type object that I receive as a dynamic from a method I would like to check in a property exists on ... View Detail
 Upvotes: 0   Answers: 0
C# object to array
Using reflection I have an object which I need to cast into an iterable list of items (type unknown, will be object). Us ... View Detail
 Upvotes: 0   Answers: 0
C# reflection - load assembly and invoke a method if it exists
I want to load an assembly (its name is stored in a string), use reflection to check if it has a method called CustomTyp ... View Detail
 Upvotes: 0   Answers: 0
Non-static method requires a target C#
I have a win form app with a listbox displaying methods (by attribute). I am attempting to dynamically invoke methods in ... View Detail
 Upvotes: 0   Answers: 0
Retrieving the calling method name from within a method
Possible Duplicate: How can I find the method that called the current method? I have a method in an object th ... View Detail
 Upvotes: 0   Answers: 0
How To Test if Type is Primitive
I have a block of code that serializes a type into a Html tag. Type t = typeof(T); // I pass <T> in as a paramter, wher ... View Detail
 Upvotes: 0   Answers: 0
Why is the use of reflection in .NET recommended?
Is it definitely a good practice to use it? What are some possible situations in a project that need reflection?
 Upvotes: 0   Answers: 0
How to check if object is an array of a certain type?
This works fine: var expectedType = typeof(string); object value = ...; if (value.GetType().IsAssignableFrom(expectedTy ... View Detail
 Upvotes: 0   Answers: 0
How can I get the value of a string property via Reflection?
public class Foo { public string Bar {get; set;} }  How do I get the value of Bar, a string property, via reflection? T ... View Detail
 Upvotes: 0   Answers: 0
Create object instance of a class having its name in string variable
I don't know the thing I am asking is available or not but I just want to know if it exists and how it works. So here is ... View Detail
 Upvotes: 0   Answers: 0
How to determine if a type implements a specific generic interface type
Assume the following type definitions: public interface IFoo<T> : IBar<T> {} public class Foo<T> : IFoo<T> {}  How do ... View Detail
 Upvotes: 0   Answers: 0
Check if a property exist in a class
I try to know if a property exist in a class, I tried this : public static bool HasProperty(this object obj, string pro ... View Detail
 Upvotes: 0   Answers: 0
C# Using Activator.CreateInstance
I asked a question yesterday regarding using either reflection or Strategy Pattern for dynamically calling methods. How ... View Detail
 Upvotes: 0   Answers: 0
Get all inherited classes of an abstract class
I have an abstract class: abstract class AbstractDataExport {   public string name;   public abstract bool ExportData() ... View Detail
 Upvotes: 0   Answers: 0
C#: How to get all public (both get and set) string properties of a type
I am trying to make a method that will go through a list of generic objects and replace all their properties of type str ... View Detail
 Upvotes: 0   Answers: 0
Using C# reflection to call a constructor
I have the following scenario: class Addition{  public Addition(int a){ a=5; }  public static int add(int a,int b) {ret ... View Detail
 Upvotes: 0   Answers: 0
What is the C# equivalent to Java's isInstance()?
I know of is and as for instanceof, but what about the reflective isInstance() method?
 Upvotes: 0   Answers: 0

Quick Links



Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..


Login to Open ESchool OR Create your account    Login   SignUp