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