using EFCoreDatabase.Data; using EFCoreDatabase.Repositories.Implement; using EFCoreDatabase.Repositories.Interface; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using NewWMSWebAPI.TaskService.Implement; using NewWMSWebAPI.TaskService.Interface; using Serilog; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddDbContext(options => options.UseDm("Server=127.0.0.1:5236;UserId=JIAMUSI_WMS_DATABASE;PWD=Siasun4813@;"), ServiceLifetime.Transient); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); Log.Information("Starting web application"); //شتذي·أخت builder.Services.AddCors(options => { options.AddPolicy("AllowSpecificOrigins", builder => { builder.WithOrigins("*") .AllowAnyHeader() .AllowAnyMethod(); }); }); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseCors("AllowSpecificOrigins"); app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run();