You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
This check should be in CanCreateModel so that it will be skipped for someone who subclassed ComplexTypeModelBinder
Also, this change adds runtime reflection to pretty hot codepath just for validation purposes. We can do this one time per-instance by moving it to the inside of this block:
if (_modelCreator == null)
{
}
The text was updated successfully, but these errors were encountered:
rynowak
changed the title
Cache call to GetConstructors in ComplexTypeModelBinder
Move call to validate constructor in ComplexTypeModelBinder into CreateModel
Feb 14, 2017
@rynowak you're talking about a bigger refactorization of ComplexTypeModelBinder than immediately evident. For one thing, the _modelCreator == null check is in CreateModel() and not CanCreateModel(); moving the constructor check there would be kinda late. For another, CanCreateModel() has a couple of successful return paths that'll need to change.
Of course, if the uncached reflection shows up in profiles, party on.
See commit here: 842d661
This check should be in
CanCreateModel
so that it will be skipped for someone who subclassedComplexTypeModelBinder
Also, this change adds runtime reflection to pretty hot codepath just for validation purposes. We can do this one time per-instance by moving it to the inside of this block:
The text was updated successfully, but these errors were encountered: