CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
NetDataContractOperationBehavior.cs
Go to the documentation of this file.
1#if !NETFX_CORE && !NETSTANDARD2_0 && !NET5_0
2//-----------------------------------------------------------------------
3// <copyright file="NetDataContractOperationBehavior.cs" company="Marimer LLC">
4// Copyright (c) Marimer LLC. All rights reserved.
5// Website: https://cslanet.com
6// </copyright>
7// <summary>Override the DataContract serialization behavior to</summary>
8//-----------------------------------------------------------------------
9using System;
10using System.Collections.Generic;
11using System.ServiceModel;
12using System.Runtime.Serialization;
13using System.Xml;
14using System.ServiceModel.Description;
15
17{
22 public class NetDataContractOperationBehavior : DataContractSerializerOperationBehavior
23 {
24#region Constructors
25
30 public NetDataContractOperationBehavior(OperationDescription operation)
31 : base(operation)
32 {
33 }
34
40 public NetDataContractOperationBehavior(OperationDescription operation, DataContractFormatAttribute dataContractFormatAttribute)
41 : base(operation, dataContractFormatAttribute)
42 {
43 }
44
45#endregion
46
47#region Overrides
48
53 public override XmlObjectSerializer CreateSerializer(Type type, string name, string ns,
54 IList<Type> knownTypes)
55 {
56 return new NetDataContractSerializer(name, ns);
57 }
58
63 public override XmlObjectSerializer CreateSerializer(Type type, XmlDictionaryString name,
64 XmlDictionaryString ns, IList<Type> knownTypes)
65 {
66 return new NetDataContractSerializer(name, ns);
67 }
68
69#endregion
70 }
71}
72#endif
Override the DataContract serialization behavior to use the NetDataContractSerializer.
NetDataContractOperationBehavior(OperationDescription operation, DataContractFormatAttribute dataContractFormatAttribute)
Create new instance of object.
override XmlObjectSerializer CreateSerializer(Type type, XmlDictionaryString name, XmlDictionaryString ns, IList< Type > knownTypes)
Overrided CreateSerializer to return an XmlObjectSerializer which is capable of preserving the object...
NetDataContractOperationBehavior(OperationDescription operation)
Create new instance of object.
override XmlObjectSerializer CreateSerializer(Type type, string name, string ns, IList< Type > knownTypes)
Overrided CreateSerializer to return an XmlObjectSerializer which is capable of preserving the object...