Skip to content

Commit 71701e6

Browse files
Drop the obsolete EnableWriteSupport configuration option
fix #654
1 parent 5dda8b2 commit 71701e6

File tree

4 files changed

+2
-26
lines changed

4 files changed

+2
-26
lines changed

docs/upgrade-guides/1.x.x-2.0.0.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,12 @@ var requestId = context.RequestId;
146146

147147
By default ServiceComposer responds only to HTTP `GET` requests, to enable write support, for example to handle `POST` requests, the following configuration can be used when adding ServiceComposer to the application:
148148

149-
<!-- snippet: enable-write-support -->
150-
<a id='snippet-enable-write-support'></a>
151149
```cs
152150
public void ConfigureServices(IServiceCollection services)
153151
{
154152
services.AddViewModelComposition(options => options.EnableWriteSupport());
155153
}
156154
```
157-
<sup><a href='/src/Snippets/WriteSupport/EnableWriteSupport.cs#L10-L15' title='Snippet source file'>snippet source</a> | <a href='#snippet-enable-write-support' title='Start of snippet'>anchor</a></sup>
158-
<!-- endSnippet -->
159155

160156
## IViewModelPreviewHandler Preview
161157

docs/upgrade-guides/2.0.0-2.1.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public void ConfigureServices(IServiceCollection services)
1717
services.AddViewModelComposition(options => options.DisableWriteSupport());
1818
}
1919
```
20-
<sup><a href='/src/Snippets/WriteSupport/EnableWriteSupport.cs#L20-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-disable-write-support' title='Start of snippet'>anchor</a></sup>
20+
<sup><a href='/src/Snippets/WriteSupport/EnableWriteSupport.cs#L9-L14' title='Snippet source file'>snippet source</a> | <a href='#snippet-disable-write-support' title='Start of snippet'>anchor</a></sup>
2121
<!-- endSnippet -->
2222

2323
When write support is disabled, `ServiceComposer.AspNetCore` will only respond to get requests.
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
using System;
22

3-
namespace ServiceComposer.AspNetCore;
4-
5-
partial class ViewModelCompositionOptions
6-
{
7-
[Obsolete("EnableWriteSupport is obsolete. Starting v2.1.0, write support is enabled by default. Use DisableWriteSupport to disable it. It'll be considered an error in v3.0.0 and removed in v4.0.0", true)]
8-
public void EnableWriteSupport()
9-
{
10-
throw new NotSupportedException();
11-
}
12-
}
3+
namespace ServiceComposer.AspNetCore;

src/Snippets/WriteSupport/EnableWriteSupport.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44

55
namespace Snippets.WriteSupport;
66

7-
public class EnableWriteSupport
8-
{
9-
[Obsolete("This snippet is used only by an upgrade guide. The Obsolete is needed to prevent the EnableWriteSupport usage here to cause the snippet compilation to fail.")]
10-
// begin-snippet: enable-write-support
11-
public void ConfigureServices(IServiceCollection services)
12-
{
13-
services.AddViewModelComposition(options => options.EnableWriteSupport());
14-
}
15-
// end-snippet
16-
}
17-
187
public class DisableWriteSupport
198
{
209
// begin-snippet: disable-write-support

0 commit comments

Comments
 (0)