WebApi + ClientApp, GraphQL, Reflection

This commit is contained in:
Boris Milašinović
2026-05-06 20:55:05 +02:00
parent 8f7c704a90
commit 4fb3de19f6
196 changed files with 10395 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using LottoInterfaces;
using System;
using System.Collections.Generic;
namespace LottoImplementation;
public class Lotto : ILotto
{
private int ballsToBeDrawn, numberOfBalls;
public string? SomeProperty { get; set; }
public Lotto(int ballsToBeDrawn, int numberOfBalls)
{
this.ballsToBeDrawn = ballsToBeDrawn;
this.numberOfBalls = numberOfBalls;
}
public List<int> DrawNumbers(bool sort)
{
List<int> list = new List<int>();
Random r = new Random(DateTime.Now.Millisecond);
int counter = ballsToBeDrawn;
while (counter > 0)
{
int x = r.Next(1, numberOfBalls + 1);
if (!list.Contains(x))
{
list.Add(x);
counter--;
}
}
if (sort)
{
list.Sort();
}
return list;
}
}