Best of Nick ChapsasOctober 2024

  1. 1
    Video
    Avatar of nickchapsasNick Chapsas·2y

    Swagger is Gone in .NET 9! Replace It With This.

    Swagger has been removed in .NET 9 and replaced with Microsoft's built-in OpenAPI functionalities. To adapt to this change, developers can use the 'app.mapOpenAPI' call for API documentation without a UI. Alternatively, they can integrate third-party tools such as Swashbuckle to restore the Swagger UI, or use Scaler, which offers a modern and customizable API documentation UI. Scaler provides various themes and integration options, including dark mode and authentication schemes, making it a versatile alternative.

  2. 2
    Video
    Avatar of nickchapsasNick Chapsas·2y

    How to Measure Time Correctly in .NET

    Nick explains the correct method to measure elapsed time in .NET applications, emphasizing that using DateTime.UtcNow is incorrect due to performance issues. He demonstrates how to implement accurate time measurement using the Stopwatch class and introduces the more efficient Stopwatch.GetTimestamp method available in .NET 7. This method avoids unnecessary allocations and provides precise time measurements by interacting directly with the operating system's low-level functions.