File tree Expand file tree Collapse file tree 3 files changed +2
-72
lines changed
src/Microsoft.AspNetCore.SystemWebAdapters.CoreServices Expand file tree Collapse file tree 3 files changed +2
-72
lines changed Original file line number Diff line number Diff line change @@ -9,44 +9,9 @@ namespace Microsoft.AspNetCore.SystemWebAdapters;
99[ AttributeUsage ( AttributeTargets . Class | AttributeTargets . Method ) ]
1010public sealed class SessionAttribute : Attribute
1111{
12- [ Obsolete ( "Prefer SessionBehavior instead." ) ]
13- public SessionBehavior Behavior
14- {
15- get
16- {
17- if ( SessionBehavior is SessionStateBehavior . Disabled )
18- {
19- return SystemWebAdapters . SessionBehavior . None ;
20- }
21-
22- return IsPreLoad ? SystemWebAdapters . SessionBehavior . Preload : SystemWebAdapters . SessionBehavior . OnDemand ;
23- }
24- set
25- {
26- SessionBehavior = value switch
27- {
28- SystemWebAdapters . SessionBehavior . None => SessionStateBehavior . Disabled ,
29- SystemWebAdapters . SessionBehavior . Preload => SessionStateBehavior . Required ,
30- SystemWebAdapters . SessionBehavior . OnDemand => SessionStateBehavior . Required ,
31- _ => throw new ArgumentOutOfRangeException ( nameof ( value ) ) ,
32- } ;
33- }
34- }
35-
3612 public SessionStateBehavior SessionBehavior { get ; set ; } = SessionStateBehavior . Required ;
3713
3814 public bool IsPreLoad { get ; set ; } = true ;
3915
40- public bool IsReadOnly
41- {
42- get => SessionBehavior is SessionStateBehavior . ReadOnly ;
43- [ Obsolete ( "Prefer SessionBehavior property" ) ]
44- set
45- {
46- if ( value )
47- {
48- SessionBehavior = SessionStateBehavior . ReadOnly ;
49- }
50- }
51- }
16+ public bool IsReadOnly => SessionBehavior is SessionStateBehavior . ReadOnly ;
5217}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22// The .NET Foundation licenses this file to you under the MIT license.
33
44using System ;
5- using System . ComponentModel ;
65using Microsoft . AspNetCore . Builder ;
76using Microsoft . AspNetCore . SystemWebAdapters ;
87using Microsoft . AspNetCore . SystemWebAdapters . SessionState . Serialization ;
1110
1211namespace Microsoft . Extensions . DependencyInjection ;
1312
14- public static class ISystemWebAdapterBuilderSessionExtensions
13+ public static class WrappedSessionExtensions
1514{
16- [ Obsolete ( "Prefer AddWrappedAspNetCoreSession instead" ) ]
17- [ EditorBrowsable ( EditorBrowsableState . Never ) ]
18- public static ISystemWebAdapterBuilder WrapAspNetCoreSession ( this ISystemWebAdapterBuilder builder , Action < SessionOptions > ? options = null )
19- => builder . AddWrappedAspNetCoreSession ( options ) ;
20-
2115 public static ISystemWebAdapterBuilder AddWrappedAspNetCoreSession ( this ISystemWebAdapterBuilder builder , Action < SessionOptions > ? options = null )
2216 {
2317 ArgumentNullException . ThrowIfNull ( builder ) ;
You can’t perform that action at this time.
0 commit comments