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.
		
		
		
		
		
			
		
			
				
					
					
						
							44 lines
						
					
					
						
							1.3 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							44 lines
						
					
					
						
							1.3 KiB
						
					
					
				
								using Biskilog_Cloud.Shared.Interfaces;
							 | 
						|
								using Microsoft.EntityFrameworkCore;
							 | 
						|
								using ServerManager;
							 | 
						|
								using ServerManager.ServiceRepo;
							 | 
						|
								using ServerManager.SyncMethods;
							 | 
						|
								
							 | 
						|
								var builder = WebApplication.CreateBuilder(args);
							 | 
						|
								
							 | 
						|
								// Add services to the container.
							 | 
						|
								builder.Services.AddSignalR();
							 | 
						|
								builder.Services.AddControllers();
							 | 
						|
								// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
							 | 
						|
								builder.Services.AddEndpointsApiExplorer();
							 | 
						|
								builder.Services.AddSwaggerGen();
							 | 
						|
								builder.Services.AddEntityFrameworkMySql().AddDbContext<BiskPosContext>(options =>
							 | 
						|
								{
							 | 
						|
								    options.UseSqlServer(builder.Configuration.GetConnectionString("Connection"));
							 | 
						|
								});
							 | 
						|
								
							 | 
						|
								builder.Services.AddScoped<SalesSync>();
							 | 
						|
								builder.Services.AddScoped<CompanySync>();
							 | 
						|
								builder.Services.AddScoped<ProductSync>();
							 | 
						|
								builder.Services.AddHostedService<Worker>();
							 | 
						|
								builder.Services.AddScoped<ISalesInterface, SalesService>();
							 | 
						|
								builder.Services.AddScoped<IUser, CompanyService>();
							 | 
						|
								builder.Services.AddScoped<ICustomer, CompanyService>();
							 | 
						|
								builder.Services.AddScoped<ICompanyInfo, CompanyService>();
							 | 
						|
								builder.Services.AddScoped<IProduct, ProductsService>();
							 | 
						|
								var app = builder.Build();
							 | 
						|
								
							 | 
						|
								// Configure the HTTP request pipeline.
							 | 
						|
								if (app.Environment.IsDevelopment())
							 | 
						|
								{
							 | 
						|
								    app.UseSwagger();
							 | 
						|
								    app.UseSwaggerUI();
							 | 
						|
								}
							 | 
						|
								
							 | 
						|
								app.UseHttpsRedirection();
							 | 
						|
								
							 | 
						|
								app.UseAuthorization();
							 | 
						|
								
							 | 
						|
								app.MapControllers();
							 | 
						|
								
							 | 
						|
								app.Run();
							 | 
						|
								
							 |