Updated editorconfig to (mostly?) require braces around if/else statements, and applied the new formatting rules

This commit is contained in:
Kwoth
2022-02-02 01:44:45 +01:00
parent b22cd5a81e
commit ffa2c3f119
202 changed files with 2108 additions and 920 deletions

View File

@@ -23,11 +23,13 @@ public static class ServiceCollectionExtensions
var baseType = typeof(ConfigServiceBase<>);
foreach (var type in Assembly.GetCallingAssembly().ExportedTypes.Where(x => x.IsSealed))
{
if (type.BaseType?.IsGenericType == true && type.BaseType.GetGenericTypeDefinition() == baseType)
{
services.AddSingleton(type);
services.AddSingleton(x => (IConfigService)x.GetRequiredService(type));
}
}
return services;
}
@@ -53,7 +55,8 @@ public static class ServiceCollectionExtensions
var subTypes = Assembly.GetCallingAssembly()
.ExportedTypes.Where(type => type.IsSealed && baseType.IsAssignableFrom(type));
foreach (var subType in subTypes) services.AddSingleton(baseType, subType);
foreach (var subType in subTypes)
services.AddSingleton(baseType, subType);
return services;
}