Class DefaultViewLocationCache
Represents a memory cache for view locations.
public class DefaultViewLocationCache : IViewLocationCache
- Inheritance
-
DefaultViewLocationCache
- Implements
- Inherited Members
Constructors
DefaultViewLocationCache()
Initializes a new instance of the DefaultViewLocationCache class.
public DefaultViewLocationCache()
DefaultViewLocationCache(TimeSpan)
Initializes a new instance of the DefaultViewLocationCache class by using the specified cache time span.
public DefaultViewLocationCache(TimeSpan timeSpan)
Parameters
timeSpan
TimeSpanThe cache time span.
Exceptions
- InvalidOperationException
The Ticks attribute of the
timeSpan
parameter is set to a negative number.
Fields
Null
Creates an empty view location cache.
public static readonly IViewLocationCache Null
Field Value
Properties
TimeSpan
Gets or sets the cache time span.
public TimeSpan TimeSpan { get; }
Property Value
- TimeSpan
The cache time span.
Methods
GetViewLocation(HttpContextBase, string)
Retrieves the default view location by using the specified HTTP context and cache key.
public string GetViewLocation(HttpContextBase httpContext, string key)
Parameters
httpContext
HttpContextBaseThe HTTP context.
key
stringThe cache key
Returns
- string
The default view location.
Exceptions
- ArgumentNullException
The
httpContext
parameter is null.
InsertViewLocation(HttpContextBase, string, string)
Inserts the view in the specified virtual path by using the specified HTTP context, cache key, and virtual path.
public void InsertViewLocation(HttpContextBase httpContext, string key, string virtualPath)
Parameters
httpContext
HttpContextBaseThe HTTP context.
key
stringThe cache key.
virtualPath
stringThe virtual path
Exceptions
- ArgumentNullException
The
httpContext
parameter is null.