// // ServiceCollectionExtensions.cs // // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Extensions.DependencyInjection; using NosSmooth.Data.NOSFiles.Readers; using NosSmooth.Data.NOSFiles.Readers.Types; namespace NosSmooth.Data.NOSFiles.Extensions; /// /// Extension methods for . /// public static class ServiceCollectionExtensions { /// /// Add the file reader and NosTale type readers. /// /// The service collection. /// The collection. public static IServiceCollection AddFileReader(this IServiceCollection serviceCollection) { return serviceCollection .AddSingleton() .AddFileTypeReader() .AddFileTypeReader(); } /// /// Add the given file type reader. /// /// The service collection. /// The type of the reader. /// The collection. public static IServiceCollection AddFileTypeReader(this IServiceCollection serviceCollection) where TTypeReader : class, IFileTypeReader { return serviceCollection.AddSingleton(); } }