Exemplo n.º 1
0
 public static void OnCreateSerializer(this ServiceHostBase host, CreateSerializer2 func)
 {
     host.ApplyDispatchBehavior(delegate
     {
         foreach (var operation in host.Description.AllOperations())
         {
             DataContractSerializerOperationBehaviorExtended.Install(operation)
                 .CreateSerializer2 = func;
         }
     });
 }
Exemplo n.º 2
0
 public static void PreserveObjectReferences(this ServiceHostBase host)
 {
     host.ApplyDispatchBehavior(delegate
     {
         foreach (var operation in host.Description.AllOperations())
         {
             DataContractSerializerOperationBehaviorExtended.Install(operation)
                 .PreserveObjectReferences = true;
         }
     });
 }
Exemplo n.º 3
0
 public static void AddMetadataMessageInspector(this ServiceHost host, IDispatchMessageInspector inspector)
 {
     host.ApplyDispatchBehavior((sd,sh) =>
     {
         foreach (var ed in host.GetMetadataEndpointDispatchers())
         {
             ed.DispatchRuntime.MessageInspectors.Add(inspector);
         }
     });
 }
Exemplo n.º 4
0
 public static void OnEndpointDispatcherAvailable(this ServiceHostBase host, Action<ServiceEndpoint, EndpointDispatcher> callback)
 {
     host.ApplyDispatchBehavior(host.Description.Endpoints, callback);
 }