コード例 #1
0
        private void RestrictDomain(ServiceHost serviceHost)
        {
            var domainScopes =
                (from domain in serviceHost.Burden().Dependencies.OfType <WcfDiscoveryDomain>()
                 from scope in domain.Scopes
                 select scope).ToArray();

            if (domainScopes.Length > 0)
            {
                AddFilter(endpoint =>
                {
                    foreach (var domainScope in domainScopes)
                    {
                        if (endpoint.Scopes.Contains(domainScope))
                        {
                            return(false);
                        }
                    }
                    return(true);
                });
            }
        }