Skip to content

Instantly share code, notes, and snippets.

@dfang
Created July 24, 2012 06:38
Show Gist options
  • Save dfang/3168409 to your computer and use it in GitHub Desktop.
Save dfang/3168409 to your computer and use it in GitHub Desktop.
nop 修改两行代码提高性能30%
public T Resolve<T>() where T : class
{
return ContainerManager.Container.IsRegistered<T>()?ContainerManager.Resolve<T>():null;
}
public object Resolve(Type type)
{
return ContainerManager.Container.IsRegistered(type)?ContainerManager.Resolve(type):null;
}
改成只剩下这两个方法
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment