public static ConfigurationBuilder <T> FromFile <T>(this ConfigurationBuilder <T> builder, string path, Action <FileReaderOptions> setupOptions = null) { var options = new FileReaderOptions(); setupOptions?.Invoke(options); builder.Reader = new FileReader(path, options); return(builder); }
static async Task Main(string[] args) { var serviceCollection = new ServiceCollection(); var fileReaderOptions = new FileReaderOptions { FilePath = Path.Combine(Directory.GetCurrentDirectory(), "sdp_input.txt") }; serviceCollection.AddLogging(); serviceCollection.AddFileReader(fileReaderOptions); serviceCollection.AddConsoleOutput(new ConsoleOutputOptions()); serviceCollection.AddSdpProcessor(); var serviceProvider = serviceCollection.BuildServiceProvider(); var sdpProcessor = serviceProvider.GetRequiredService <ISdpProcessor>(); await sdpProcessor.Start(); }
public FileReader CreateFileReader(string fileName) { var options = new FileReaderOptions(); return(new FileReader(fileName, options)); }