using Microsoft.AspNetCore.SignalR;
using WebApplication1.Models;

namespace WebApplication1
{
    public record A
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
    public class Program
    {
        public static void Main(string[] args)
        {
            List<A> a = new();

            var builder = WebApplication.CreateBuilder(args);

            // Add services to the container.
            builder.Services.AddControllersWithViews();

            builder.Services.AddSignalR();
            var app = builder.Build();

            // Configure the HTTP request pipeline.
            if (!app.Environment.IsDevelopment())
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.MapControllerRoute(
                name: "default",
                pattern: "{controller=Home}/{action=Index}/{id?}");

            app.UseEndpoints((endpoint)=>
            {
                endpoint.MapHub<tui>("/tongzhi");
            });
            app.Run();
        }
    }
}
