SessionMiddleware docs
Fix docs for SessionMiddleware Fix typos Fix docs
This commit is contained in:
parent
e6afe46edc
commit
93490c4750
|
|
@ -15,6 +15,9 @@ using Microsoft.Framework.OptionsModel;
|
|||
|
||||
namespace Microsoft.AspNet.Session
|
||||
{
|
||||
/// <summary>
|
||||
/// Enables the session state for the application.
|
||||
/// </summary>
|
||||
public class SessionMiddleware
|
||||
{
|
||||
private static readonly RandomNumberGenerator CryptoRandom = RandomNumberGenerator.Create();
|
||||
|
|
@ -25,6 +28,13 @@ namespace Microsoft.AspNet.Session
|
|||
private readonly ILogger _logger;
|
||||
private readonly ISessionStore _sessionStore;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="SessionMiddleware"/>.
|
||||
/// </summary>
|
||||
/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param>
|
||||
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/> representing the factory that used to create logger instances.</param>
|
||||
/// <param name="sessionStore">The <see cref="ISessionStore"/> representing the session store.</param>
|
||||
/// <param name="options">The session configuration options.</param>
|
||||
public SessionMiddleware(
|
||||
[NotNull] RequestDelegate next,
|
||||
[NotNull] ILoggerFactory loggerFactory,
|
||||
|
|
@ -38,6 +48,11 @@ namespace Microsoft.AspNet.Session
|
|||
_sessionStore.Connect();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes the logic of the middleware.
|
||||
/// </summary>
|
||||
/// <param name="context">The <see cref="HttpContext"/>.</param>
|
||||
/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns>
|
||||
public async Task Invoke(HttpContext context)
|
||||
{
|
||||
var isNewSessionKey = false;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,16 @@ using Microsoft.Framework.Internal;
|
|||
|
||||
namespace Microsoft.AspNet.Builder
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for adding the <see cref="SessionMiddleware"/> to an application.
|
||||
/// </summary>
|
||||
public static class SessionMiddlewareExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds the <see cref="SessionMiddleware"/> to automatically enable session state for the application.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
|
||||
/// <returns>The <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseSession([NotNull] this IApplicationBuilder app)
|
||||
{
|
||||
return app.UseMiddleware<SessionMiddleware>();
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ using Microsoft.Framework.Internal;
|
|||
namespace Microsoft.Framework.DependencyInjection
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for adding session servics to the DI container.
|
||||
/// Extension methods for adding session services to the DI container.
|
||||
/// </summary>
|
||||
public static class SessionServiceCollectionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds services required for application session.
|
||||
/// Adds services required for application session state.
|
||||
/// </summary>
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param>
|
||||
/// <returns>The <see cref="IServiceCollection"/>.</returns>
|
||||
|
|
|
|||
Loading…
Reference in New Issue