Example #1
0
        public static void Run()
        {
            var s1 = new Score(5, 0);

            Console.WriteLine($"ID: {s1.GetId()}");

            var m1 = new Winner3Way(
                new Outcome.Priced(1.85m),
                new Outcome.Priced(3.3m),
                new Outcome.Priced(2.0m));

            var outcomes = m1.GetOutcomes();

            Console.WriteLine($"Outcomes: {string.Join(",", outcomes)}");

            var newOutcomes = outcomes.Select(pair => (pair.Item1,
                                                       pair.Item2 switch {
                Outcome.Priced c => c with {
                    Price = c.Price * 1.1m
                },
Example #2
0
 public static Protobuf.OutcomePriced FromDomain(this Outcome.Priced v)
 => new Protobuf.OutcomePriced()
 {
     Price = DecimalToLong(v.Price, 3)
 };