Skip to content

Instantly share code, notes, and snippets.

@alistairjevans
Created June 8, 2019 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alistairjevans/5c37b2fb7db6f9e0312f38a49dae6209 to your computer and use it in GitHub Desktop.
Save alistairjevans/5c37b2fb7db6f9e0312f38a49dae6209 to your computer and use it in GitHub Desktop.
ConfigureServices.cs
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