nice refactorings

This commit is contained in:
2022-10-10 03:17:14 +03:00
parent 4ca234aec8
commit 28a6981001
30 changed files with 622 additions and 141 deletions
@@ -0,0 +1,20 @@
using Microsoft.Extensions.DependencyInjection;
namespace PracticeCalendar.UnitTests.Integration
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection Remove<TService>(this IServiceCollection services)
{
var serviceDescriptor = services.FirstOrDefault(d =>
d.ServiceType == typeof(TService));
if (serviceDescriptor != null)
{
services.Remove(serviceDescriptor);
}
return services;
}
}
}