Created
June 8, 2019 11:20
-
-
Save alistairjevans/5c37b2fb7db6f9e0312f38a49dae6209 to your computer and use it in GitHub Desktop.
ConfigureServices.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
// Define a writer that saves my data to disk | |
var folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), | |
"rower"); | |
services.AddSingleton<ISampleWriter>(svc => new SampleWriter(folderPath, "samples")); | |
// Keep my machine state as a singleton | |
services.AddSingleton<IMachineState, MachineState>(); | |
services.AddControllersWithViews() | |
.AddNewtonsoftJson(); | |
services.AddRazorPages(); | |
// Add signalr services | |
services.AddSignalR(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment