Skip to content

⭐ Shared

Terrence Daniels edited this page Aug 15, 2026 · 2 revisions

Not a .csproj project — a linked-source folder compiled directly into consuming projects (which is exactly why it's absent from eShop.slnx). Both files reviewed for code quality and left unchanged, since each has a real, load-bearing reason for what might otherwise look like an oversight:

  • ActivityExtensions.cs — no namespace, deliberately: the global namespace lets any consuming project call .SetExceptionTags() without a using statement. Its internal null-check on the Activity receiver isn't defensive padding either — it's an extension method, callable on a null receiver, and RabbitMQEventBus.cs (see EventBusRabbitMQ) relies on that by calling it without ?..
  • MigrateDbContextExtensions.cs — deliberately overrides BackgroundService.StartAsync, not the more commonly-overridden ExecuteAsync, so host startup actually waits for the migration to finish before the app reports itself ready. Correct on inspection, not an accident. Revisited later for a DRY/SOLID pass: two near-identical StartActivity/try-catch/tag shapes extracted into one shared helper, and IDbSeeder<TContext> moved into its own Abstractions/IDbSeeder.cs for discoverability.

Clone this wiki locally