using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Dto.ChangeBoxRecord;
using WMS.Web.Core.Dto.Inventory;
using WMS.Web.Core.Dto.MoveBoxRecord;
using WMS.Web.Core.Dto.OutStock;
using WMS.Web.Core.Dto.OutStockTask;
using WMS.Web.Core.Dto.TakeStock;
using WMS.Web.Domain.Infrastructure;
using WMS.Web.Repositories;
using WMS.Web.Repositories.Configuration;
using WMS.Web.Repositories.DependencyInjection;
namespace Microsoft.Extensions.DependencyInjection
{
public static class AppBuilderExtensions
{
///
/// 配置数据库
///
///
///
///
public static AppBuilder AddDbContext(this AppBuilder builder, Action configureDbContext)
{
builder.Services.AddDbContext(configureDbContext);
builder.Services.AddRepositories();
return builder;
}
///
/// 注入仓储层
///
///
private static void AddRepositories(this IServiceCollection services)
{
services.AddHttpContextAccessor();
services.AddScoped();
//services.AddScoped();
services.AddTransient();
services.AddTransient();
services.AddTransient();
#region 导出
services.AddTransient, OutStockTaskRepositories>();
services.AddTransient, TakeStockRepositories>();
services.AddTransient, OutStockRepositories>();
services.AddTransient, MoveBoxRecordRepositories>();
services.AddTransient, ChangeBoxRecordRepositories>();
services.AddTransient, InStockRepositories>();
services.AddTransient, InStockTaskRepositories>();
services.AddTransient, InventoryDetailsRepositories>();
services.AddTransient, InventoryInOutDetailsRepositories>();
services.AddTransient, BoxInventoryRepositories>();
#endregion
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
}
}
}