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.
50 lines
2.2 KiB
50 lines
2.2 KiB
2 years ago
|
using LinqToDB.AspNet;
|
||
|
using LinqToDB.AspNet.Logging;
|
||
|
using LinqToDB.Configuration;
|
||
|
using Microsoft.Extensions.Configuration;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
using Volo.Abp.Modularity;
|
||
|
using Win_in.Sfs.Wms.DataExchange.Dapper.Fawtyg.Tyrp.Parts;
|
||
|
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
|
||
|
using Win_in.Sfs.Wms.DataExchange.LinqToDB.Fawtyg.Tyrp.Backflushs;
|
||
|
using Win_in.Sfs.Wms.DataExchange.LinqToDB.Fawtyg.Tyrp.Boms;
|
||
|
using Win_in.Sfs.Wms.DataExchange.LinqToDB.Fawtyg.Tyrp.Customers;
|
||
|
using Win_in.Sfs.Wms.DataExchange.LinqToDB.Fawtyg.Tyrp.Dictpjs;
|
||
|
using Win_in.Sfs.Wms.DataExchange.LinqToDB.Fawtyg.Tyrp.Products;
|
||
|
using Win_in.Sfs.Wms.DataExchange.LinqToDB.Fawtyg.Tyrp.Venders;
|
||
|
|
||
|
namespace Win_in.Sfs.Wms.DataExchange.Dapper.Fawtyg.Tyrp;
|
||
|
|
||
|
[DependsOn(
|
||
|
typeof(DataExchangeDomainFawtygTyrpModule)
|
||
|
|
||
|
)]
|
||
|
public class DataExchangeDapperFawtygModule : AbpModule
|
||
|
{
|
||
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
||
|
{
|
||
|
var configuration = context.Services.GetConfiguration();
|
||
|
|
||
|
context.Services.AddLinqToDBContext<TyrpDb>((provider, options) =>
|
||
|
{
|
||
|
options
|
||
|
//will configure the TyrpDb to use
|
||
|
//sybase with the provided connection string
|
||
|
//there are methods for each supported database
|
||
|
.UseAse(configuration.GetConnectionString("SYBASE_TYRP"))
|
||
|
//default logging will log everything using the ILoggerFactory configured in the provider
|
||
|
.UseDefaultLogging(provider);
|
||
|
});
|
||
|
|
||
|
context.Services.AddTransient<TyrpDb>();
|
||
|
|
||
|
context.Services.AddTransient<IPartLinq2DbRepository, PartLinq2DbRepository>();
|
||
|
context.Services.AddTransient<IBomLinq2DbRepository, BomLinq2DbRepository>();
|
||
|
context.Services.AddTransient<ISupplierLinq2DbRepository, SupplierLinq2DbRepository>();
|
||
|
context.Services.AddTransient<IProductLinq2DbRepository, ProductLinq2DbRepository>();
|
||
|
context.Services.AddTransient<IDictpjLinq2DbRepository, DictpjLinq2DbRepository>();
|
||
|
context.Services.AddTransient<ICustomerLinq2DbRepository, CustomerLinq2DbRepository>();
|
||
|
context.Services.AddTransient<IBackfluLinq2DbRepository, BackfluLinq2DbRepository>();
|
||
|
}
|
||
|
}
|