Improve MVC 3, 4 application View DI performance
Ignore MVC view service injection check to improve MVC 3, 4 view object creation performance.
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Spring.Web.Mvc
|
||||
/// </summary>
|
||||
public class SpringMvcDependencyResolver : IDependencyResolver
|
||||
{
|
||||
private static readonly string IgnoreViewNamespace = "ASP.";
|
||||
|
||||
private IApplicationContext _context;
|
||||
|
||||
@@ -66,6 +67,10 @@ namespace Spring.Web.Mvc
|
||||
/// <returns>The requested service or object.</returns>
|
||||
public object GetService(Type serviceType)
|
||||
{
|
||||
if (serviceType.FullName.StartsWith(IgnoreViewNamespace))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
object service = null;
|
||||
|
||||
if (serviceType != null)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Spring.Web.Mvc
|
||||
/// </summary>
|
||||
public class SpringMvcDependencyResolver : IDependencyResolver
|
||||
{
|
||||
|
||||
private static readonly string IgnoreViewNamespace = "ASP.";
|
||||
/// <summary>
|
||||
/// The <see cref="IApplicationContext"/> to be used by the resolver
|
||||
/// </summary>
|
||||
@@ -70,6 +70,10 @@ namespace Spring.Web.Mvc
|
||||
/// <returns>The requested service or object.</returns>
|
||||
public object GetService(Type serviceType)
|
||||
{
|
||||
if (serviceType.FullName.StartsWith(IgnoreViewNamespace))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
object service = null;
|
||||
|
||||
if (serviceType != null)
|
||||
|
||||
Reference in New Issue
Block a user