SessionMiddleware docs

Fix docs for SessionMiddleware

Fix typos

Fix docs
This commit is contained in:
Hisham Abdullah Bin Ateya 2015-06-26 04:06:03 +03:00
parent e6afe46edc
commit 93490c4750
3 changed files with 25 additions and 2 deletions

View File

@ -15,6 +15,9 @@ using Microsoft.Framework.OptionsModel;
namespace Microsoft.AspNet.Session namespace Microsoft.AspNet.Session
{ {
/// <summary>
/// Enables the session state for the application.
/// </summary>
public class SessionMiddleware public class SessionMiddleware
{ {
private static readonly RandomNumberGenerator CryptoRandom = RandomNumberGenerator.Create(); private static readonly RandomNumberGenerator CryptoRandom = RandomNumberGenerator.Create();
@ -25,6 +28,13 @@ namespace Microsoft.AspNet.Session
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly ISessionStore _sessionStore; 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( public SessionMiddleware(
[NotNull] RequestDelegate next, [NotNull] RequestDelegate next,
[NotNull] ILoggerFactory loggerFactory, [NotNull] ILoggerFactory loggerFactory,
@ -38,6 +48,11 @@ namespace Microsoft.AspNet.Session
_sessionStore.Connect(); _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) public async Task Invoke(HttpContext context)
{ {
var isNewSessionKey = false; var isNewSessionKey = false;

View File

@ -6,8 +6,16 @@ using Microsoft.Framework.Internal;
namespace Microsoft.AspNet.Builder namespace Microsoft.AspNet.Builder
{ {
/// <summary>
/// Extension methods for adding the <see cref="SessionMiddleware"/> to an application.
/// </summary>
public static class SessionMiddlewareExtensions 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) public static IApplicationBuilder UseSession([NotNull] this IApplicationBuilder app)
{ {
return app.UseMiddleware<SessionMiddleware>(); return app.UseMiddleware<SessionMiddleware>();

View File

@ -8,12 +8,12 @@ using Microsoft.Framework.Internal;
namespace Microsoft.Framework.DependencyInjection namespace Microsoft.Framework.DependencyInjection
{ {
/// <summary> /// <summary>
/// Extension methods for adding session servics to the DI container. /// Extension methods for adding session services to the DI container.
/// </summary> /// </summary>
public static class SessionServiceCollectionExtensions public static class SessionServiceCollectionExtensions
{ {
/// <summary> /// <summary>
/// Adds services required for application session. /// Adds services required for application session state.
/// </summary> /// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> /// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param>
/// <returns>The <see cref="IServiceCollection"/>.</returns> /// <returns>The <see cref="IServiceCollection"/>.</returns>