|
1 |
| -using System; |
| 1 | +// There is no support of WCF Server under .Net Core, so it makes little sense to provide |
| 2 | +// a WCF OperationContext for it. Since it adds additional heavy dependencies, it has been |
| 3 | +// considered not desirable to provide it for .Net Standard. (It could be useful in case some |
| 4 | +// WCF server becames available in another frameworks or if a .Net Framework application |
| 5 | +// consumes the .Net Standard distribution of NHibernate instead of the .Net Framework one.) |
| 6 | +// See https://github.com/dotnet/wcf/issues/1200 and #1842 |
| 7 | +#if NETFX |
2 | 8 | using System.Collections;
|
3 | 9 | using System.ServiceModel;
|
4 | 10 |
|
@@ -50,3 +56,36 @@ public void Attach(OperationContext owner) { }
|
50 | 56 | public void Detach(OperationContext owner) { }
|
51 | 57 | }
|
52 | 58 | }
|
| 59 | +#else |
| 60 | +// 6.0 TODO: remove the whole #else |
| 61 | +using System; |
| 62 | +using System.Collections; |
| 63 | +using NHibernate.Engine; |
| 64 | + |
| 65 | +namespace NHibernate.Context |
| 66 | +{ |
| 67 | + /// <summary> |
| 68 | + /// Obsolete class not usable with the current framework. Use the |
| 69 | + /// .Net Framework distribution of NHibernate if you need it. See |
| 70 | + /// https://github.com/nhibernate/nhibernate-core/issues/1842 |
| 71 | + /// </summary> |
| 72 | + [Obsolete("Not supported in this platform", true)] |
| 73 | + public class WcfOperationSessionContext : MapBasedSessionContext |
| 74 | + { |
| 75 | + public WcfOperationSessionContext(ISessionFactoryImplementor factory) : base(factory) |
| 76 | + { |
| 77 | + throw new PlatformNotSupportedException( |
| 78 | + "WcfOperationSessionContext is not supported for the current framework"); |
| 79 | + } |
| 80 | + |
| 81 | + protected override IDictionary GetMap() |
| 82 | + { |
| 83 | + return null; |
| 84 | + } |
| 85 | + |
| 86 | + protected override void SetMap(IDictionary value) |
| 87 | + { |
| 88 | + } |
| 89 | + } |
| 90 | +} |
| 91 | +#endif |
0 commit comments