コード例 #1
0
ファイル: Serialization.cs プロジェクト: alexdej/wcfextras
 public static void OnCreateSerializer(this ServiceHostBase host, CreateSerializer2 func)
 {
     host.ApplyDispatchBehavior(delegate
     {
         foreach (var operation in host.Description.AllOperations())
         {
             DataContractSerializerOperationBehaviorExtended.Install(operation)
                 .CreateSerializer2 = func;
         }
     });
 }
コード例 #2
0
ファイル: Serialization.cs プロジェクト: alexdej/wcfextras
 public static void PreserveObjectReferences(this ServiceHostBase host)
 {
     host.ApplyDispatchBehavior(delegate
     {
         foreach (var operation in host.Description.AllOperations())
         {
             DataContractSerializerOperationBehaviorExtended.Install(operation)
                 .PreserveObjectReferences = true;
         }
     });
 }
コード例 #3
0
ファイル: Metadata.cs プロジェクト: alexdej/wcfextras
 public static void AddMetadataMessageInspector(this ServiceHost host, IDispatchMessageInspector inspector)
 {
     host.ApplyDispatchBehavior((sd,sh) =>
     {
         foreach (var ed in host.GetMetadataEndpointDispatchers())
         {
             ed.DispatchRuntime.MessageInspectors.Add(inspector);
         }
     });
 }
コード例 #4
0
ファイル: Dispatcher.cs プロジェクト: alexdej/wcfextras
 public static void OnEndpointDispatcherAvailable(this ServiceHostBase host, Action<ServiceEndpoint, EndpointDispatcher> callback)
 {
     host.ApplyDispatchBehavior(host.Description.Endpoints, callback);
 }