Ejemplo n.º 1
0
 public IAddressModel Select(AddressSelectContext context)
 {
     Check.NotNull(context, nameof(context));
     if (context.AddressModels.Count(p => p.Enabled) == 1 &&
         AddressSelectorMode != AddressSelectorMode.HashAlgorithm)
     {
         return(context.AddressModels.First(p => p.Enabled));
     }
     return(SelectAddressByAlgorithm(context));
 }
Ejemplo n.º 2
0
        protected override IAddressModel SelectAddressByAlgorithm(AddressSelectContext context)
        {
            var index = _generate(0, context.AddressModels.Length);

            return(context.AddressModels[index]);
        }
Ejemplo n.º 3
0
 protected abstract IAddressModel SelectAddressByAlgorithm(AddressSelectContext context);