Skip to content

Commit be85681

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 5df3462 commit be85681

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,3 +453,11 @@ $RECYCLE.BIN/
453453
!.vscode/tasks.json
454454
!.vscode/launch.json
455455
!.vscode/extensions.json
456+
.playwright-mcp/page-2026-04-09T15-39-29-782Z.yml
457+
.playwright-mcp/page-2026-04-09T15-39-44-759Z.yml
458+
.playwright-mcp/page-2026-04-09T15-43-13-904Z.yml
459+
.playwright-mcp/page-2026-04-09T15-43-17-310Z.png
460+
.playwright-mcp/page-2026-04-09T15-43-49-218Z.yml
461+
.playwright-mcp/page-2026-04-09T15-44-01-963Z.png
462+
.playwright-mcp/page-2026-04-09T15-44-13-179Z.png
463+
slides/Slides.html

slides/Slides.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ footer: 'https://chris-ayers.com'
1111

1212
## Chris Ayers
1313

14-
![bg right:40%](./img/dotnet-logo.png)
14+
![bg right:50%](./img/dotnet-logo.png)
1515

1616
---
1717

@@ -590,6 +590,8 @@ public class FileOptions
590590

591591
---
592592

593+
<!-- _class: full-width -->
594+
593595
# Types of IOptions
594596

595597
| | Singleton | Reloading Support | Named Option Support |
@@ -732,8 +734,6 @@ public class DatabaseOptions
732734
[RegularExpression(@"^[a-zA-Z0-9_]+$")]
733735
public string DatabaseName { get; set; } = "";
734736
}
735-
736-
// Register with validation
737737
services.AddOptions<DatabaseOptions>()
738738
.Bind(configuration.GetSection("Database"))
739739
.ValidateDataAnnotations()
@@ -753,11 +753,9 @@ public class DatabaseOptionsValidator : IValidateOptions<DatabaseOptions>
753753
var failures = new List<string>();
754754

755755
if (string.IsNullOrEmpty(options.ConnectionString))
756-
failures.Add("ConnectionString is required");
757-
756+
failures.Add("ConnectionString is required");
758757
if (options.CommandTimeoutSeconds <= 0)
759758
failures.Add("CommandTimeoutSeconds must be positive");
760-
761759
if (!IsValidDatabaseName(options.DatabaseName))
762760
failures.Add("Invalid database name format");
763761

@@ -814,13 +812,11 @@ var app = builder.Build();
814812
- **Better DevEx**: Immediate feedback during development
815813

816814
```csharp
817-
// Custom validation method
818815
services.AddOptions<MyOptions>()
819816
.Bind(configuration.GetSection("MySection"))
820817
.Validate(options =>
821-
{
822-
return options.ApiKey?.Length >= 10;
823-
}, "ApiKey must be at least 10 characters")
818+
{ return options.ApiKey?.Length >= 10; },
819+
"ApiKey must be at least 10 characters")
824820
.ValidateOnStart();
825821
```
826822

slides/themes/dotnet.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,18 @@ section pre code {
143143
section table {
144144
border-collapse: collapse;
145145
width: 100%;
146+
max-width: 100%;
147+
table-layout: fixed;
146148
font-size: 0.85em;
147149
border-radius: 8px;
148150
overflow: hidden;
151+
margin: 0.5em 0;
152+
}
153+
154+
/* Add to dotnet.css for explicit full-width tables */
155+
section table.full-width {
156+
width: 100% !important;
157+
display: table;
149158
}
150159

151160
section table th {

0 commit comments

Comments
 (0)