Stack Exchange
Wrapper class wrapping multiple types and composition pattern
I have a wrapper class as following which wraps TypeA,TypeB and TypeC.
class Wrapper
{
    class TypeA {get;set;}
    class TypeB {get;set;}
    class TypeC{get;set;}
}

Now caller code is not good because of this. As I have to determine based on the different types like this:
Wrapper wrapper = new Wrapper(TypeA);

if (wrapper.TypeA != null && wrapper.TypeA.SomeProperty != null)
{
    return wrapper.TypeA.SomeProperty;
}

if (wrapper.TypeB != null && wrapper.TypeB.SomeProperty != null)
{
    return wrapper.TypeB.SomeProperty;
}

Wrapper cwrapper = new Wrapper(TypeA, TypeB);

if (wrapper.TypeA == null && wrapper.TypeB != null && wrapper.TypeB.SomeProperty != null)
{
    return wrapper.TypeB.SomeProperty;
}

As you see, the caller code has to check for lot of combination of TypeA and TypeB and TypeC as well. 
I was just thinking to use some composition and expose some strategy or property which will give me desired object such as:
wrapper.As<TypeA>() or something. Any suggestion how to avoid this multiple checks from the caller part?

Can it wrap multiple objects at the same time?

Do Types A, B and C implement the same interface?

Do the properties have exactly the same name in each type. Is there a corresponding property for each property in each type? How many properties will you need to access like this?

Yes it can wrap multiple object at the same time and it has bunch of other properties with different names.

Why? You are using kind a Adapter Pattern and your class should look like
class Wrapper
{
    public TypeA A {get;set;}
    public TypeB B {get;set;}
    public TypeC C{get;set;}

  public Wrapper(TypeA A, TypeB B, TypeC C)
  {
   this.A = A;
   // rest initialization
  }
}

You can now just say 
Wrapper w = new Wrapper(new TypeA(), ...);
w.A.SomeProperty;

Again, instead of that null check if condition you can use Null Propagation operator like
wrapper?.TypeA?.SomeProperty;

You can use a Null Coalesce operator together in-order to return a default value of property in case property is null
wrapper?.TypeA?.SomeProperty ?? string.Empty;


I would suggest using some guard clauses in your constructor and some readonly properties to tidy all this up 
class Wrapper
{
    public TypeA A {get;}
    public TypeB B {get;}
    public TypeC C {get;}

  public Wrapper(TypeA A, TypeB B, TypeC C)
  {
   this.A = A ?? throw new ArgumentNullException(nameof(A));
   this.B = B ?? throw new ArgumentNullException(nameof(B));
   this.C = C ?? throw new ArgumentNullException(nameof(C));
  }
}

Now unless someone has done something silly with reflection your A,B,C properties can't be null. So you don't need to null check.
You can then use the null-coalescing operator to tidy up the last bits
wrapper.A.someProperty ?? string.Empty


Like you suggested, I would use a type of cast convenience method. Something like this:
class Wrapper {
    bool TryGet<T> (out T wrappedObj) {
        if (typeof(T) == ClassA.GetType()) {
            wrappedObj = objA;
        }
        //...
        return wrappedObj != null;
    }

    // or
    bool TryGet<T,U>(Func<U> propGetter, out U prop) {
        if (TryGet<T>(out T wrappedObj)) {
            prop = propGetter(wrappedObj);
            return true;
        }
        prop = default(U); 
        return false;
    }
}

if (wrapper.TryGet<ClassA>(out ClassA obj)) {
//...
}

//or

if (wrapper.TryGet<ClassA, String>(aObj =>  aObj?.SomeProperty, out String prop) {

}

