Files
BeWoPlaner/Service/Multitenancy/MultitenancyEndpointBehavior.cs
2016-06-27 01:45:38 +02:00

31 lines
1.0 KiB
C#

using System;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
namespace BeWo.Service.Multitenancy
{
public class MultitenancyEndpointBehavior : IEndpointBehavior
{
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
{
}
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
throw new NotImplementedException("This is a server behavior only");
}
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
foreach (DispatchOperation iOperation in endpointDispatcher.DispatchRuntime.Operations)
{
iOperation.CallContextInitializers.Add(new MultitenancyContextInitializer());
}
}
public void Validate(ServiceEndpoint endpoint)
{
}
}
}