You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
615 B
C#

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using SlnMesnac.Rfid.Factory;
namespace SlnMesnac.Rfid
{
public static class RfidSetup
{
public static void AddRfidSetup(this IServiceCollection services)
{
services.AddSingleton<RfidPool>();
services.AddSingleton<RflyFactory>();
}
public static IApplicationBuilder UseRfidExtensions(this IApplicationBuilder app)
{
var pool = app.ApplicationServices.GetService<RfidPool>();
pool.Init();
return app;
}
}
}