public override RouterConfig WithFallback(RouterConfig routerConfig)
{
if (routerConfig is FromConfig || routerConfig is NoRouter)
{
return base.WithFallback(routerConfig);
}
else if (routerConfig is ConsistentHashingGroup)
{
var other = routerConfig as ConsistentHashingGroup;
return WithHashMapping(other.HashMapping);
}
else
{
throw new ArgumentException(string.Format("Expected ConsistentHashingGroup, got {0}", routerConfig),
"routerConfig");
}
}