6 references to SelectByWeight
Microsoft.Extensions.Http.Resilience (4)
Routing\Internal\OrderedGroups\OrderedGroupsRoutingStrategy.cs (1)
41
nextRoute = group!.Endpoints.
SelectByWeight
(e => e.Weight, Randomizer!).Uri!;
Routing\Internal\WeightedGroups\WeightedGroupsRoutingStrategy.cs (3)
57
nextRoute = group!.Endpoints.
SelectByWeight
(e => e.Weight, Randomizer).Uri!;
83
return _groups.
SelectByWeight
(g => g.Weight, Randomizer);
92
return _groups.
SelectByWeight
(g => g.Weight, Randomizer);
Microsoft.Extensions.Http.Resilience.Tests (2)
Routing\RoutingHelperTest.cs (2)
23
var result = new List<int> { 1, 2, 3, 4 }.
SelectByWeight
(v => v, randomizer.Object);
34
Assert.Throws<InvalidOperationException>(() => new List<int> { 1, 2, 3, 4 }.
SelectByWeight
(v => v, randomizer.Object));