Skip to content

Commit e4d7f39

Browse files
📝 Add docstrings to feature/seed-substitute-players
Docstrings generation was requested by @nanotaboada. * #334 (comment) The following files were modified: * `scripts/run-migrations-and-copy-database.sh` * `src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs`
1 parent 5288f24 commit e4d7f39

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

scripts/run-migrations-and-copy-database.sh

100755100644
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ PROJECT_BASE_PATH="$PROJECT_ROOT_PATH/bin/Debug/net8.0"
88
SOURCE_FILE_PATH="$PROJECT_BASE_PATH/storage/$DATA_FILE"
99
TARGET_FILE_PATH="$PROJECT_ROOT_PATH/storage/$DATA_FILE"
1010

11+
# log prints a formatted log message prefixed by an emoji and timestamp, followed by the log level and message.
12+
# Parameters: emoji — emoji or symbol to prefix the entry; level — severity or level label; message — the log text.
1113
log() {
1214
local emoji=$1
1315
local level=$2
@@ -60,4 +62,4 @@ if [ -f "$TARGET_FILE_PATH" ]; then
6062
else
6163
log "⚠️" "WARNING" "Something went wrong. The destination file was not found."
6264
exit 1
63-
fi
65+
fi

src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Text.Json;
1+
using System.Text.Json;
22
using Dotnet.Samples.AspNetCore.WebApi.Enums;
33
using Dotnet.Samples.AspNetCore.WebApi.Models;
44

@@ -153,6 +153,10 @@ public static List<Player> MakeStarting11()
153153
];
154154
}
155155

156+
/// <summary>
157+
/// Create a predefined starting eleven of players where each player has a fixed GUID identifier and full profile data.
158+
/// </summary>
159+
/// <returns>A list of 11 Player instances representing the starting lineup; each entry includes a predefined Id (Guid) and populated fields such as name, date of birth, squad number, position (and abbreviation), team, league, and Starting11 set to true.</returns>
156160
public static List<Player> MakeStarting11WithId()
157161
{
158162
return
@@ -311,6 +315,10 @@ public static List<Player> MakeStarting11WithId()
311315
];
312316
}
313317

318+
/// <summary>
319+
/// Creates a predefined list of substitute Player objects with their properties populated and Starting11 set to false.
320+
/// </summary>
321+
/// <returns>A List&lt;Player&gt; containing sample substitute players. Each entry is populated with player details but does not include an Id value.</returns>
314322
public static List<Player> GetSubstitutes()
315323
{
316324
return
@@ -510,6 +518,10 @@ public static List<Player> GetSubstitutes()
510518
];
511519
}
512520

521+
/// <summary>
522+
/// Creates a predefined list of substitute players, each populated with a specific GUID Id and player metadata.
523+
/// </summary>
524+
/// <returns>A List&lt;Player&gt; containing substitute players with Starting11 set to false and explicit Id values.</returns>
513525
public static List<Player> GetSubstitutesWithId()
514526
{
515527
return
@@ -881,4 +893,4 @@ public static List<Player> MakeStarting11FromDeserializedJson()
881893

882894
private static readonly JsonSerializerOptions options =
883895
new() { PropertyNameCaseInsensitive = true };
884-
}
896+
}

0 commit comments

Comments
 (0)