I have a method, that gets a variable of base-class type, but I pass variables of child-classes to this method.

Simple example:

```
public class Shape {
    public string Color {get;set;}    
}

public class Square : Shape {
    public int Corners {get;set;}    
}

public class Circle : Shape {
    public int Radius {get;set;}    
}

```

Some method like:

```
public void GetDetails(Shape item){
    // do something        
}

```

Then I pass child-class objects to this method:

```
var sq = new Square();
var cir = new Circle();
var corners = GetDetails(sq);
var radius = GetDetails(cir);

```

Question:

How can this method detect what type has actually came? Assume that in foreach cycle I go through List, so I cant know what type each item really is (Square or Circle).

My actual issue is:

I pack different child-class-type variables into List of base-class-type. Then I send this List to a method, and inside of it I want to get all properties of each class. I implement it via "reflections", but method .GetProperties() returns only properties of base class, but I also need properties of derived one.