Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check whether collection is constructible throws exception #29

Closed
malagbek opened this issue May 14, 2014 · 1 comment
Closed

Check whether collection is constructible throws exception #29

malagbek opened this issue May 14, 2014 · 1 comment

Comments

@malagbek
Copy link

Depending on .net framework or some other issue method
public static bool IsInstantiableCollection(Type colType)
within ReflectionUtils.cs fails somewhere deep in .net guts.

In order to check whether type has default constructor it is sufficient to check for
return colType.GetConstructor(Type.EmptyTypes) != null;
which works nicely without try/catch block.

sinairv added a commit that referenced this issue May 17, 2014
@sinairv
Copy link
Collaborator

sinairv commented May 17, 2014

It looks much cleaner. Thanks.

@sinairv sinairv closed this as completed May 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants