These are not classes, that you're showing us. Classes are made using the class keyword. Like this
public class Object1 {
public string prop1 {get; set;}
public int prop2 {get; set;}
}
public class Object2 {
public int prop1 {get; set;}
public bool prop2 {get; set;}
}
You can have same names among different classes. There is no need to name them differently, since they're in different classes. But you weren't having them in different classes, you were having them in different don't-know-whether-that-was-a-class-or-function-or-whatever thing.
Once you do so you will have the classes. To create such a function I think you will do this
SetValues(T){
}
You can pass either first object or the second. You were having an extra parameter data type, of objectType, which would have caused compiler error. C# allows generic types, so it is ok to let the compiler handle what would be better to cast the object to.