Skip to content

Commit

Permalink
More doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbrandenburg committed Jul 8, 2019
1 parent 72d4e3a commit d3cad4c
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 44 deletions.
40 changes: 24 additions & 16 deletions src/Caching/Abstractions/src/MemoryCacheEntryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ public static class MemoryCacheEntryExtensions
/// <summary>
/// Sets the priority for keeping the cache entry in the cache during a memory pressure tokened cleanup.
/// </summary>
/// <param name="options"></param>
/// <param name="priority"></param>
/// <param name="options">The option on which to set the priority.</param>
/// <param name="priority">The <see cref="CacheItemPriority"/> to set on the option.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions SetPriority(
this MemoryCacheEntryOptions options,
CacheItemPriority priority)
Expand All @@ -24,8 +25,9 @@ public static MemoryCacheEntryOptions SetPriority(
/// <summary>
/// Sets the size of the cache entry value.
/// </summary>
/// <param name="options"></param>
/// <param name="size"></param>
/// <param name="options">The option to set the size of.</param>
/// <param name="size">The size to set on the <see cref="MemoryCacheEntryOptions"/>.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions SetSize(
this MemoryCacheEntryOptions options,
long size)
Expand All @@ -44,6 +46,7 @@ public static MemoryCacheEntryOptions SetSize(
/// </summary>
/// <param name="options">The <see cref="MemoryCacheEntryOptions"/>.</param>
/// <param name="expirationToken">The <see cref="IChangeToken"/> that causes the cache entry to expire.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions AddExpirationToken(
this MemoryCacheEntryOptions options,
IChangeToken expirationToken)
Expand All @@ -60,8 +63,9 @@ public static MemoryCacheEntryOptions AddExpirationToken(
/// <summary>
/// Sets an absolute expiration time, relative to now.
/// </summary>
/// <param name="options"></param>
/// <param name="relative"></param>
/// <param name="options">The <see cref="MemoryCacheEntryOptions"/>.</param>
/// <param name="relative">The expiration time, relative to now.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions SetAbsoluteExpiration(
this MemoryCacheEntryOptions options,
TimeSpan relative)
Expand All @@ -73,8 +77,9 @@ public static MemoryCacheEntryOptions SetAbsoluteExpiration(
/// <summary>
/// Sets an absolute expiration date for the cache entry.
/// </summary>
/// <param name="options"></param>
/// <param name="absolute"></param>
/// <param name="options">The <see cref="MemoryCacheEntryOptions"/>.</param>
/// <param name="absolute">The expiration time, in absolute terms.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions SetAbsoluteExpiration(
this MemoryCacheEntryOptions options,
DateTimeOffset absolute)
Expand All @@ -87,8 +92,9 @@ public static MemoryCacheEntryOptions SetAbsoluteExpiration(
/// Sets how long the cache entry can be inactive (e.g. not accessed) before it will be removed.
/// This will not extend the entry lifetime beyond the absolute expiration (if set).
/// </summary>
/// <param name="options"></param>
/// <param name="offset"></param>
/// <param name="options">The <see cref="MemoryCacheEntryOptions"/>.</param>
/// <param name="offset">The sliding expiration time.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions SetSlidingExpiration(
this MemoryCacheEntryOptions options,
TimeSpan offset)
Expand All @@ -100,8 +106,9 @@ public static MemoryCacheEntryOptions SetSlidingExpiration(
/// <summary>
/// The given callback will be fired after the cache entry is evicted from the cache.
/// </summary>
/// <param name="options"></param>
/// <param name="callback"></param>
/// <param name="options">The <see cref="MemoryCacheEntryOptions"/>.</param>
/// <param name="callback">The callback to register for calling after an entry is evicted.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions RegisterPostEvictionCallback(
this MemoryCacheEntryOptions options,
PostEvictionDelegate callback)
Expand All @@ -117,9 +124,10 @@ public static MemoryCacheEntryOptions RegisterPostEvictionCallback(
/// <summary>
/// The given callback will be fired after the cache entry is evicted from the cache.
/// </summary>
/// <param name="options"></param>
/// <param name="callback"></param>
/// <param name="state"></param>
/// <param name="options">The <see cref="MemoryCacheEntryOptions"/>.</param>
/// <param name="callback">The callback to register for calling after an entry is evicted.</param>
/// <param name="state">The state to pass to the callback.</param>
/// <returns>The <see cref="MemoryCacheEntryOptions"/> so that additional calls can be chained.</returns>
public static MemoryCacheEntryOptions RegisterPostEvictionCallback(
this MemoryCacheEntryOptions options,
PostEvictionDelegate callback,
Expand All @@ -138,4 +146,4 @@ public static MemoryCacheEntryOptions RegisterPostEvictionCallback(
return options;
}
}
}
}
2 changes: 1 addition & 1 deletion src/Caching/Memory/src/MemoryCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public MemoryCache(IOptions<MemoryCacheOptions> optionsAccessor)
/// Creates a new <see cref="MemoryCache"/> instance.
/// </summary>
/// <param name="optionsAccessor">The options of the cache.</param>
/// <param name="loggerFactory"></param>
/// <param name="loggerFactory">The factory used to create loggers.</param>
public MemoryCache(IOptions<MemoryCacheOptions> optionsAccessor, ILoggerFactory loggerFactory)
{
if (optionsAccessor == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static IHost Start(this IHostBuilder hostBuilder)
/// Builds and starts the host.
/// </summary>
/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to start.</param>
/// <param name="cancellationToken"></param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the health check.</param>
/// <returns>The started <see cref="IHost"/>.</returns>
public static async Task<IHost> StartAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Hosting/Abstractions/src/IHostBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,31 @@ public interface IHostBuilder
/// <summary>
/// Overrides the factory used to create the service provider.
/// </summary>
/// <typeparam name="TContainerBuilder"></typeparam>
/// <param name="factory"></param>
/// <typeparam name="TContainerBuilder">The type of builder.</typeparam>
/// <param name="factory">The factory to register/</param>
/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns>
IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory);

/// <summary>
/// Overrides the factory used to create the service provider.
/// </summary>
/// <typeparam name="TContainerBuilder"></typeparam>
/// <typeparam name="TContainerBuilder">The type of builder.</typeparam>
/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns>
IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory);

/// <summary>
/// Enables configuring the instantiated dependency container. This can be called multiple times and
/// the results will be additive.
/// </summary>
/// <typeparam name="TContainerBuilder"></typeparam>
/// <param name="configureDelegate"></param>
/// <typeparam name="TContainerBuilder">The type of builder.</typeparam>
/// <param name="configureDelegate">The delegate which configures the builder.</param>
/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns>
IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate);

/// <summary>
/// Run the given actions to initialize the host. This can only be called once.
/// </summary>
/// <returns>An initialized <see cref="IHost"/></returns>
/// <returns>An initialized <see cref="IHost"/>.</returns>
IHost Build();
}
}
4 changes: 2 additions & 2 deletions src/Hosting/Hosting/src/HostingHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder, Act
/// Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.
/// </summary>
/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param>
/// <param name="cancellationToken"></param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the health check.</param>
/// <returns></returns>
public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default)
{
Expand All @@ -164,7 +164,7 @@ public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationTo
/// </summary>
/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param>
/// <param name="configureOptions"></param>
/// <param name="cancellationToken"></param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the health check.</param>
/// <returns></returns>
public static Task RunConsoleAsync(this IHostBuilder hostBuilder, Action<ConsoleLifetimeOptions> configureOptions, CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public static class WindowsServiceLifetimeHostBuilderExtensions
/// This is context aware and will only activate if it detects the process is running
/// as a Windows Service.
/// </remarks>
/// <param name="hostBuilder"></param>
/// <returns></returns>
/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to operate on.</param>
/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns>
public static IHostBuilder UseWindowsService(this IHostBuilder hostBuilder)
{
if (WindowsServiceHelpers.IsWindowsService())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public virtual IEnumerable<LocalizedString> GetAllStrings(bool includeParentCult
/// <summary>
/// Returns all strings in the specified culture.
/// </summary>
/// <param name="includeParentCultures"></param>
/// <param name="includeParentCultures">Whether to include parent cultures in the search for a resource.</param>
/// <param name="culture">The <see cref="CultureInfo"/> to get strings for.</param>
/// <returns>The strings.</returns>
protected IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures, CultureInfo culture)
Expand Down
1 change: 0 additions & 1 deletion src/Logging/Logging.Abstractions/src/ILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public interface ILogger
/// <returns><c>true</c> if enabled.</returns>
bool IsEnabled(LogLevel logLevel);


/// <summary>
/// Begins a logical operation scope.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public BlobLoggerProvider(IOptionsMonitor<AzureBlobLoggerOptions> options)
/// Creates a new instance of <see cref="BlobLoggerProvider"/>
/// </summary>
/// <param name="blobReferenceFactory">The container to store logs to.</param>
/// <param name="options"></param>
/// <param name="options">Options to be used in creating a logger.</param>
internal BlobLoggerProvider(
IOptionsMonitor<AzureBlobLoggerOptions> options,
Func<string, ICloudAppendBlob> blobReferenceFactory) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static ILoggingBuilder AddConsole(this ILoggingBuilder builder)
/// Adds a console logger named 'Console' to the factory.
/// </summary>
/// <param name="builder">The <see cref="ILoggingBuilder"/> to use.</param>
/// <param name="configure"></param>
/// <param name="configure">A delegate to configure the <see cref="ConsoleLogger"/>.</param>
public static ILoggingBuilder AddConsole(this ILoggingBuilder builder, Action<ConsoleLoggerOptions> configure)
{
if (configure == null)
Expand Down
4 changes: 2 additions & 2 deletions src/Logging/Logging.EventSource/src/EventSourceLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
if (exception != null)
{
var exceptionInfo = GetExceptionInfo(exception);
var exceptionInfoData = new []
var exceptionInfoData = new[]
{
new KeyValuePair<string, string>("TypeName", exceptionInfo.TypeName),
new KeyValuePair<string, string>("Message", exceptionInfo.Message),
Expand Down Expand Up @@ -179,7 +179,7 @@ public void Dispose()
/// <summary>
/// 'serializes' a given exception into an ExceptionInfo (that EventSource knows how to serialize)
/// </summary>
/// <param name="exception"></param>
/// <param name="exception">The exception to get information for.</param>
/// <returns>ExceptionInfo object represending a .NET Exception</returns>
/// <remarks>ETW does not support a concept of a null value. So we use an un-initialized object if there is no exception in the event data.</remarks>
private ExceptionInfo GetExceptionInfo(Exception exception)
Expand Down
8 changes: 4 additions & 4 deletions src/Logging/Logging.EventSource/src/LoggingEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ protected override void OnEventCommand(EventCommandEventArgs command)
/// <summary>
/// Set the filtering specification. null means turn off all loggers. Empty string is turn on all providers.
/// </summary>
/// <param name="filterSpec"></param>
/// <param name="filterSpec">The filter specification to set.</param>
[NonEvent]
private void SetFilterSpec(string filterSpec)
{
Expand All @@ -298,7 +298,7 @@ private void FireChangeToken()
tcs?.Cancel();
}

/// <summary>
/// <summary>
/// Given a set of specifications Pat1:Level1;Pat1;Level2 ... Where
/// Pat is a string pattern (a logger Name with a optional trailing wildcard * char)
/// and Level is a number 0 (Trace) through 5 (Critical).
Expand All @@ -314,7 +314,7 @@ private static LoggerFilterRule[] ParseFilterSpec(string filterSpec, LogLevel de
{
if (filterSpec == string.Empty)
{
return new [] { new LoggerFilterRule(typeof(EventSourceLoggerProvider).FullName, null, defaultLevel, null) };
return new[] { new LoggerFilterRule(typeof(EventSourceLoggerProvider).FullName, null, defaultLevel, null) };
}

var rules = new List<LoggerFilterRule>();
Expand All @@ -335,7 +335,7 @@ private static LoggerFilterRule[] ParseFilterSpec(string filterSpec, LogLevel de
continue;
}

if (loggerName[loggerName.Length-1] == '*')
if (loggerName[loggerName.Length - 1] == '*')
{
loggerName = loggerName.Substring(0, loggerName.Length - 1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Logging/Logging/src/FilterLoggingBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, Func<strin
/// <summary>
/// Adds a log filter to the factory.
/// </summary>
/// /// <param name="builder">The <see cref="ILoggingBuilder"/> to add the filter to.</param>
/// <param name="builder">The <see cref="ILoggingBuilder"/> to add the filter to.</param>
/// <param name="categoryLevelFilter">The filter to be added.</param>
/// <returns>The <see cref="ILoggingBuilder"/> so that additional calls can be chained.</returns>
public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, Func<string, LogLevel, bool> categoryLevelFilter) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DataAnnotationValidateOptions<TOptions> : IValidateOptions<TOptions
/// <summary>
/// Constructor.
/// </summary>
/// <param name="name"></param>
/// <param name="name">The name of the option.</param>
public DataAnnotationValidateOptions(string name)
{
Name = name;
Expand All @@ -41,8 +41,8 @@ public ValidateOptionsResult Validate(string name, TOptions options)
{
var validationResults = new List<ValidationResult>();
if (Validator.TryValidateObject(options,
new ValidationContext(options, serviceProvider: null, items: null),
validationResults,
new ValidationContext(options, serviceProvider: null, items: null),
validationResults,
validateAllProperties: true))
{
return ValidateOptionsResult.Success;
Expand Down
4 changes: 2 additions & 2 deletions src/Options/Options/src/PostConfigureOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public PostConfigureOptions(string name, Action<TOptions> action)
/// <summary>
/// Invokes the registered initialization <see cref="Action"/> if the <paramref name="name"/> matches.
/// </summary>
/// <param name="name"></param>
/// <param name="options"></param>
/// <param name="name">The name of the action to invoke.</param>
/// <param name="options">The options to use in initialization.</param>
public virtual void PostConfigure(string name, TOptions options)
{
if (options == null)
Expand Down

0 comments on commit d3cad4c

Please sign in to comment.