Register Timecop's IClock with Microsoft.DependencyInjection in one line of code.
Supports .NET 6 and 7.
You can install Timecop.Extensions.DependencyInjection from NuGet using your IDE or the .NET CLI:
dotnet add package Timecop.Extensions.DependencyInjection
The following code registers the implementation of IClock that always returns the current time. The instance is registered as a singletone.
using TCop.Extensions.DependencyInjection;
services.AddTimecop();Timecop.Extensions.DependencyInjection was created by Dmytro Khmara and is licensed under the MIT license.