Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object blankObject = null;
- foreach (var paramInfo in _methods[methodName].Key.GetParameters())
- {
- if (paramInfo.Name == paramName)
- {
- Type paramType = paramInfo.ParameterType;
- blankObject = (object)default(paramType);
- }
- }
- parameters[i] = blankObject;
- public object GetDefault(Type type)
- {
- return type.IsValueType ? Activator.CreateInstance(type) : null;
- }
- public void MyMethod<T>(T obj)
- {
- T myvar = default(T);
- }
Add Comment
Please, Sign In to add comment