2025-11-28 14:54:24 +01:00
|
|
|
|
using System;
|
2025-02-20 18:39:11 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.ServiceModel.Channels;
|
|
|
|
|
|
using System.ServiceModel.Description;
|
|
|
|
|
|
using System.ServiceModel.Dispatcher;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BeWo.Service.ServiceBehavior
|
|
|
|
|
|
{
|
|
|
|
|
|
public class AdminMultitenancyBehavior : 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 AdminMultitenancyContextInitializer());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Validate(ServiceEndpoint endpoint)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|