You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Framework/src/Connected.Runtime/RuntimeStartup.cs

30 lines
837 B

using Connected.Annotations;
using Connected.ServiceModel;
using Connected.ServiceModel.Transactions;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
[assembly: MicroService(MicroServiceType.Sys)]
namespace Connected;
internal sealed class RuntimeStartup : Startup
{
public static WebApplication? Application { get; private set; }
protected override void OnConfigure(WebApplication app)
{
Application = app;
}
protected override void OnConfigureServices(IServiceCollection services)
{
services.AddSingleton(typeof(IContextProvider), typeof(ContextProvider));
services.AddScoped(typeof(IContext), typeof(Context));
services.AddScoped(typeof(ITransactionContext), typeof(TransactionContext));
services.AddScoped(typeof(ICancellationContext), typeof(CancellationContext));
}
}