-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
namespace Monambike.Web.Data | ||
namespace Monambike.Web.Models | ||
{ | ||
public class Curiosity | ||
{ | ||
public List<string> Curiosities { get; set; } = new List<string>(); | ||
|
||
/// <summary> | ||
/// The curiosities file path. | ||
/// </summary> | ||
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)]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@page "/media" | ||
@using Monambike.Core.Data; | ||
@inject NavigationManager NavManager | ||
|
||
@code { | ||
protected override void OnInitialized() => NavManager.NavigateTo($"https://monambike.notion.site/a4f651d1cf7143fa93dd8158e979ade4?v=1829d81a3f5f4483b7d462e729b9f2bf&pvs=74"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters