diff --git a/src/Monambike.Web/Models/Curiosity.cs b/src/Monambike.Web/Models/Curiosity.cs index ada22450..874a0a73 100644 --- a/src/Monambike.Web/Models/Curiosity.cs +++ b/src/Monambike.Web/Models/Curiosity.cs @@ -1,24 +1,26 @@ -namespace Monambike.Web.Data +namespace Monambike.Web.Models { public class Curiosity { public List Curiosities { get; set; } = new List(); + /// + /// The curiosities file path. + /// public StreamReader CuriositiesFile = new(@"..\Resources\Curiosities.txt"); public Curiosity() { + // Reads every line until the end of curiosities file while (!CuriositiesFile.EndOfStream) { + // Getting the line var line = CuriositiesFile.ReadLine(); + // If the line is not null, add into the list if (line is not null) Curiosities.Add(line); } } - private string GetRandomCuriosity() - { - var random = new Random(); - return Curiosities[random.Next(1, Curiosities.Count)]; - } + private string GetRandomCuriosity() => Curiosities[new Random().Next(1, Curiosities.Count)]; } } diff --git a/src/Monambike.Web/Monambike.Web.csproj b/src/Monambike.Web/Monambike.Web.csproj index 0a4671e1..6ffbc5bb 100644 --- a/src/Monambike.Web/Monambike.Web.csproj +++ b/src/Monambike.Web/Monambike.Web.csproj @@ -57,6 +57,8 @@ + + diff --git a/src/Monambike.Web/Pages/Home/Tour.razor b/src/Monambike.Web/Pages/Home/Tour.razor index fce5d802..170cf2a5 100644 --- a/src/Monambike.Web/Pages/Home/Tour.razor +++ b/src/Monambike.Web/Pages/Home/Tour.razor @@ -4,7 +4,7 @@

POR ONDE COMEÇAR?