BlazorApp/Bullet6/Program.cs

26 lines
807 B
C#

using Bullet6.Solution1;
using Bullet6.Solution2;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace Bullet6
{
public class Program
{
static async Task Main(string[] args)
{
ServiceCollection services = new ServiceCollection();
services.AddSingleton<ISolution1Service, Solution1Service>();
services.AddSingleton<ISolution2Service, Solution2Service>();
var serviceProvider = services.BuildServiceProvider();
List<IFlow> flows = new List<IFlow>()
{
serviceProvider.GetRequiredService<ISolution1Service>(),
serviceProvider.GetRequiredService<ISolution2Service>()
};
foreach (var flow in flows) await flow.Start();
}
}
}