public OddResult PickOdd(SportMatch sportMatch) { OddResult oddResult = new OddResult() { OddValue = -1, ExpectedResult = "I" }; List <OddResult> values = new List <OddResult>() { new OddResult { OddValue = sportMatch.HtOdd, ExpectedResult = "H" }, new OddResult { OddValue = sportMatch.DrawOdd, ExpectedResult = "D" }, new OddResult { OddValue = sportMatch.AtOdd, ExpectedResult = "A" } }.OrderBy(o => o.OddValue).ToList(); int middleIndex = (values.Count() - 1) / 2; oddResult = values.ToArray()[middleIndex]; return(oddResult); }
public OddResult PickOdd(SportMatch sportMatch) { OddResult oddResult = new OddResult() { OddValue = -1, ExpectedResult = "I" }; List <OddResult> values = new List <OddResult>() { new OddResult { OddValue = sportMatch.HtOdd, ExpectedResult = "H" }, new OddResult { OddValue = sportMatch.DrawOdd, ExpectedResult = "D" }, new OddResult { OddValue = sportMatch.AtOdd, ExpectedResult = "A" } }.OrderByDescending(o => o.OddValue).ToList(); oddResult = values.ToArray()[0]; return(oddResult); }