This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[assembly: PreApplicationStartMethod(typeof(MvcApplication), "PreStartApp")] | |
namespace Sample | |
{ | |
public class MvcApplication : System.Web.HttpApplication | |
{ | |
public static void PreStartApp() | |
{ | |
//code | |
} | |
protected void Application_Start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. | |
using System.Web.Mvc.Properties; | |
using System.Web.Routing; | |
using System.Web.SessionState; | |
namespace System.Web.Mvc | |
{ | |
public class MvcRouteHandler : IRouteHandler | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Threading; | |
using System.Web.Mvc.Async; | |
using System.Web.Mvc.Properties; | |
using System.Web.Routing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Diagnostics.Contracts; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class DefaultDependencyResolver : IDependencyResolver | |
{ | |
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "This method might throexceptions whose type we cannot strongly link against; namely, ActivationException from common service locator")] | |
public object GetService(Type serviceType) | |
{ | |
// Since attempting to create an instance of an interface or an abstract type results in an exception, immediatelreturn null | |
// to improve performance and the debugging experience with first-chance exceptions enabled. | |
if (serviceType.IsInterface || serviceType.IsAbstract) | |
{ | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System.Web.Mvc | |
{ | |
public class DependencyResolver | |
{ | |
private static DependencyResolver _instance = new DependencyResolver(); | |
private IDependencyResolver _current; | |
/// <summary> | |
/// Cache should always be a new CacheDependencyResolver(_current). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System.Web.Mvc | |
{ | |
public abstract class ControllerBase : IController | |
{ | |
private readonly SingleEntryGate _executeWasCalledGate = new SingleEntryGate(); | |
private DynamicViewDataDictionary _dynamicViewDataDictionary; | |
private TempDataDictionary _tempDataDictionary; | |
private bool _validateRequest = true; | |
private IValueProvider _valueProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System.Web.Mvc | |
{ | |
[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Class complexity dictated by public surface area")] | |
public abstract class Controller : ControllerBase, IActionFilter, IAuthenticationFilter, IAuthorizationFilter, IDisposable, IExceptionFilter, IResultFilter, IAsyncController, IAsyncManagerContainer | |
{ | |
private static readonly object _executeTag = new object(); | |
private static readonly object _executeCoreTag = new object(); | |
private readonly AsyncManager _asyncManager = new AsyncManager(); | |
private IActionInvoker _actionInvoker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System.Web.Mvc | |
{ | |
public class ViewResult : ViewResultBase | |
{ | |
private string _masterName; | |
public string MasterName | |
{ | |
get { return _masterName ?? String.Empty; } | |
set { _masterName = value; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System.Web.Mvc | |
{ | |
public class ControllerBuilder | |
{ | |
private static ControllerBuilder _instance = new ControllerBuilder(); | |
private Func<IControllerFactory> _factoryThunk = () => null; | |
private HashSet<string> _namespaces = new HashSet<string>(StringComparer.OrdinalIgnoreCase); | |
private IResolver<IControllerFactory> _serviceResolver; | |
public ControllerBuilder() |
OlderNewer