基于Blazor开发的BS版WMS
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.
 
 
 
 

59 lines
1.8 KiB

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<DmDBContext>(options =>
options.UseDm("Server=127.0.0.1:5236;UserId=JIAMUSI_WMS_DATABASE;PWD=Siasun4813@;"),
ServiceLifetime.Transient);
builder.Services.AddScoped<IControlRepository,ControlRepository>();
builder.Services.AddScoped<IGoodsRepository, GoodsRepository>();
builder.Services.AddScoped<IManageRepository, ManageRepository>();
builder.Services.AddScoped<IPlanRepository, PlanRepository>();
builder.Services.AddScoped<IWhCellRepository, WhCellRepository>();
builder.Services.AddScoped<IManageHelper, ManageHelper>();
builder.Services.AddScoped<IStorageRepository, StorageRepository>();
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();