Skip to content

Commit ec9c98f

Browse files
author
Matthias Gessinger
committed
Implement DeprecationPolicyManager
1 parent 8622463 commit ec9c98f

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
3+
namespace Asp.Versioning;
4+
5+
/// <summary>
6+
/// Defines the behavior of an API version deprecation policy manager.
7+
/// </summary>
8+
public interface IDeprecationPolicyManager : IPolicyManager<DeprecationPolicy>
9+
{ }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
3+
namespace Asp.Versioning;
4+
5+
/// <content>
6+
/// Provides additional content specific to ASP.NET Web API.
7+
/// </content>
8+
public partial class DeprecationPolicyManager
9+
{
10+
private readonly ApiVersioningOptions options;
11+
12+
/// <inheritdoc/>
13+
protected override ApiVersioningOptions Options => options;
14+
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="DeprecationPolicyManager"/> class.
17+
/// </summary>
18+
/// <param name="options">The associated <see cref="ApiVersioningOptions">API versioning options</see>.</param>
19+
public DeprecationPolicyManager( ApiVersioningOptions options ) => this.options = options;
20+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
3+
namespace Asp.Versioning;
4+
5+
using Microsoft.Extensions.Options;
6+
7+
/// <content>
8+
/// Provides additional content specific to ASP.NET Core.
9+
/// </content>
10+
public partial class DeprecationPolicyManager
11+
{
12+
private readonly IOptions<ApiVersioningOptions> options;
13+
14+
/// <inheritdoc/>
15+
protected override ApiVersioningOptions Options => options.Value;
16+
17+
/// <summary>
18+
/// Initializes a new instance of the <see cref="DeprecationPolicyManager"/> class.
19+
/// </summary>
20+
/// <param name="options">The associated <see cref="ApiVersioningOptions">API versioning options</see>.</param>
21+
public DeprecationPolicyManager( IOptions<ApiVersioningOptions> options ) => this.options = options;
22+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
3+
namespace Asp.Versioning;
4+
5+
/// <summary>
6+
/// Represents the default API version sunset policy manager.
7+
/// </summary>
8+
public partial class DeprecationPolicyManager : PolicyManager<DeprecationPolicy, DeprecationPolicyBuilder>, IDeprecationPolicyManager
9+
{ }

0 commit comments

Comments
 (0)