internal static InstancingMode GetInstancingModeAttribute(this NetHttpChannelManager manager) { return(manager.GetType().GetCustomAttributes(typeof(NetHttpInstancingModeAttribute), true) .Cast <NetHttpInstancingModeAttribute>() .Select(attribute => attribute.Mode).DefaultIfEmpty(InstancingMode.PerCall).SingleOrDefault()); }