Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Restore missing API from Extensions
  • Loading branch information
ericstj committed Jun 8, 2023
commit 01cfe3e1779b9024f7f46124c0088678ac8a45cb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public partial class MemoryCacheOptions : Microsoft.Extensions.Options.IOptions<
public MemoryCacheOptions() { }
public Microsoft.Extensions.Internal.ISystemClock? Clock { get { throw null; } set { } }
public double CompactionPercentage { get { throw null; } set { } }
[System.Obsolete("This is obsolete and will be removed in a future version.")]
public bool CompactOnMemoryPressure { get; set; }
public System.TimeSpan ExpirationScanFrequency { get { throw null; } set { } }
Microsoft.Extensions.Caching.Memory.MemoryCacheOptions Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Caching.Memory.MemoryCacheOptions>.Value { get { throw null; } }
public long? SizeLimit { get { throw null; } set { } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public long? SizeLimit
}
}

[System.Obsolete("This is obsolete and will be removed in a future version.")]
public bool CompactOnMemoryPressure { get; set; }

/// <summary>
/// Gets or sets the amount to compact the cache by when the maximum size is exceeded.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public void Reload() { }
}
public partial class ConfigurationSection : Microsoft.Extensions.Configuration.IConfiguration, Microsoft.Extensions.Configuration.IConfigurationSection
{
public ConfigurationSection(Microsoft.Extensions.Configuration.ConfigurationRoot root, string path) { }
public ConfigurationSection(Microsoft.Extensions.Configuration.IConfigurationRoot root, string path) { }
public string? this[string key] { get { throw null; } set { } }
public string Key { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public ConfigurationSection(IConfigurationRoot root, string path)
_path = path;
}

/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="root">The configuration root.</param>
/// <param name="path">The path to this section.</param>
public ConfigurationSection(ConfigurationRoot root, string path) : this((IConfigurationRoot)root, path)
{ }

/// <summary>
/// Gets the full path to this section from the <see cref="IConfigurationRoot"/>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,8 @@ public static partial class HostingEnvironmentExtensions
public static bool IsStaging(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
}
[System.ObsoleteAttribute("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
public partial interface IApplicationLifetime
public partial interface IApplicationLifetime : Microsoft.Extensions.Hosting.IHostApplicationLifetime
{
System.Threading.CancellationToken ApplicationStarted { get; }
System.Threading.CancellationToken ApplicationStopped { get; }
System.Threading.CancellationToken ApplicationStopping { get; }
void StopApplication();
}
public partial interface IHost : System.IDisposable
{
Expand Down Expand Up @@ -128,12 +124,8 @@ public partial interface IHostEnvironment
string EnvironmentName { get; set; }
}
[System.ObsoleteAttribute("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")]
public partial interface IHostingEnvironment
public partial interface IHostingEnvironment : Microsoft.Extensions.Hosting.IHostEnvironment
{
string ApplicationName { get; set; }
Microsoft.Extensions.FileProviders.IFileProvider ContentRootFileProvider { get; set; }
string ContentRootPath { get; set; }
string EnvironmentName { get; set; }
}
public partial interface IHostLifetime
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,6 @@ namespace Microsoft.Extensions.Hosting
/// </para>
/// </summary>
[Obsolete("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
public interface IApplicationLifetime
{
/// <summary>
/// Triggered when the application host has fully started and is about to wait
/// for a graceful shutdown.
/// </summary>
CancellationToken ApplicationStarted { get; }

/// <summary>
/// Triggered when the application host is performing a graceful shutdown.
/// Requests may still be in flight. Shutdown will block until this event completes.
/// </summary>
CancellationToken ApplicationStopping { get; }

/// <summary>
/// Triggered when the application host is performing a graceful shutdown.
/// All requests should be complete at this point. Shutdown will block
/// until this event completes.
/// </summary>
CancellationToken ApplicationStopped { get; }

/// <summary>
/// Requests termination of the current application.
/// </summary>
void StopApplication();
}
public interface IApplicationLifetime : IHostApplicationLifetime
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,6 @@ namespace Microsoft.Extensions.Hosting
/// </para>
/// </summary>
[Obsolete("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")]
public interface IHostingEnvironment
{
/// <summary>
/// Gets or sets the name of the environment. The host automatically sets this property to the value of the
/// of the "environment" key as specified in configuration.
/// </summary>
string EnvironmentName { get; set; }

/// <summary>
/// Gets or sets the name of the application. This property is automatically set by the host to the assembly containing
/// the application entry point.
/// </summary>
string ApplicationName { get; set; }

/// <summary>
/// Gets or sets the absolute path to the directory that contains the application content files.
/// </summary>
string ContentRootPath { get; set; }

/// <summary>
/// Gets or sets an <see cref="IFileProvider"/> pointing at <see cref="ContentRootPath"/>.
/// </summary>
IFileProvider ContentRootFileProvider { get; set; }
}
public interface IHostingEnvironment : IHostEnvironment
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ public partial class ConsoleLifetime : Microsoft.Extensions.Hosting.IHostLifetim
{
public ConsoleLifetime(Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> options, Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> hostOptions) { }
public ConsoleLifetime(Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> options, Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> hostOptions, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { }
[System.ObsoleteAttribute("IHostingEnvironment and IApplicationLifetime have been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment and IHostApplicationLifetime instead.")]
public ConsoleLifetime(Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> options, Microsoft.Extensions.Hosting.IHostingEnvironment environment, Microsoft.Extensions.Hosting.IApplicationLifetime applicationLifetime) { }
public void Dispose() { }
public System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task WaitForStartAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public partial class ConsoleLifetime : IHostLifetime, IDisposable
private CancellationTokenRegistration _applicationStartedRegistration;
private CancellationTokenRegistration _applicationStoppingRegistration;

[Obsolete("IHostingEnvironment and IApplicationLifetime have been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment and IHostApplicationLifetime instead.")]
public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostingEnvironment environment, IApplicationLifetime applicationLifetime)
: this (options, environment, applicationLifetime, new OptionsWrapper<HostOptions>(new HostOptions())) { }

public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions<HostOptions> hostOptions)
: this(options, environment, applicationLifetime, hostOptions, NullLoggerFactory.Instance) { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,41 @@ public NullLogger() { }
public void Log<TState>(Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, TState state, System.Exception? exception, System.Func<TState, System.Exception?, string> formatter) { }
}
}
namespace Microsoft.Extensions.Logging.Abstractions.Internal
{
[System.ObsoleteAttribute("TODO")]
public partial class NullScope
{
internal NullScope() { }
public static Microsoft.Extensions.Logging.Abstractions.Internal.NullScope Instance { get { throw null; } }
public void Dispose() { }
}
[System.ObsoleteAttribute("TODO")]
public partial class TypeNameHelper
{
public TypeNameHelper() { }
public static string GetTypeDisplayName(System.Type type) { throw null; }
}
}
namespace Microsoft.Extensions.Logging.Internal
{
[System.ObsoleteAttribute("TODO")]
public partial class FormattedLogValues
{
public FormattedLogValues(string format, params object[] values) { }
public int Count { get { throw null; } }
public System.Collections.Generic.KeyValuePair<string, object> this[int index] { get { throw null; } }
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> GetEnumerator() { throw null; }
public override string ToString() { throw null; }
}
[System.ObsoleteAttribute("TODO")]
public partial class LogValuesFormatter
{
public LogValuesFormatter(string format) { }
public string OriginalFormat { get { throw null; } }
public System.Collections.Generic.List<string> ValueNames { get { throw null; } }
public string Format(object[] values) { throw null; }
public System.Collections.Generic.KeyValuePair<string, object> GetValue(object[] values, int index) { throw null; }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>> GetValues(object[] values) { throw null; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;

namespace Microsoft.Extensions.Logging.Abstractions.Internal
{
[System.Obsolete("TODO")]
public partial class NullScope
{
internal NullScope() { }

public static NullScope Instance { get { throw new NotImplementedException(); } }

public void Dispose() { }
}

[System.Obsolete("TODO")]
public partial class TypeNameHelper
{
public TypeNameHelper() { }

public static string GetTypeDisplayName(System.Type type) { throw new NotImplementedException(); }
}
}

namespace Microsoft.Extensions.Logging.Internal
{
[System.Obsolete("TODO")]
public partial class FormattedLogValues
{
public FormattedLogValues(string format, params object[] values) { }

public int Count { get { throw new NotImplementedException(); } }

public System.Collections.Generic.KeyValuePair<string, object> this[int index] { get { throw new NotImplementedException(); } }

public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> GetEnumerator() { throw new NotImplementedException(); }

public override string ToString() { throw new NotImplementedException(); }
}

[System.Obsolete("TODO")]
public partial class LogValuesFormatter
{
public LogValuesFormatter(string format) { }

public string OriginalFormat { get { throw new NotImplementedException(); } }

public System.Collections.Generic.List<string> ValueNames { get { throw new NotImplementedException(); } }

public string Format(object[] values) { throw new NotImplementedException(); }

public System.Collections.Generic.KeyValuePair<string, object> GetValue(object[] values, int index) { throw new NotImplementedException(); }

public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>> GetValues(object[] values) { throw new NotImplementedException(); }
}
}
Loading