c# - How to check typeof parameters in method? -
how check typeof parameters in method code contracts?
i need check type argument in method
how about
public void mymethod(object parameter) { if (parameter.gettype() == typeof(int32)) { //do stuff } }
in continuation other question
class managercar : iblalba { public void render(iviewtemplate template) { if (template.gettype() == typeof(carviewtemplate)) { //do stuff } } }
Comments
Post a Comment