JiShe.CollectBus/JiShe.CollectBus.MongoDB/JiSheCollectBusMongoDBModule.cs

30 lines
944 B
C#
Raw Normal View History

2024-11-13 17:50:52 +08:00
using JiShe.CollectBus.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
2024-11-13 00:30:24 +08:00
using Volo.Abp.Modularity;
2024-11-13 17:50:52 +08:00
using Volo.Abp.Timing;
2024-10-30 17:49:05 +08:00
namespace JiShe.CollectBus.MongoDB
{
2024-11-13 17:50:52 +08:00
[DependsOn(typeof(AbpTimingModule),
typeof(JiSheCollectBusEntityFrameworkCoreModule))]
2024-11-13 00:30:24 +08:00
public class JiSheCollectBusMongoDbModule: AbpModule
2024-10-30 17:49:05 +08:00
{
2024-11-13 17:50:52 +08:00
public override void PreConfigureServices(ServiceConfigurationContext context)
{
}
2024-11-13 00:30:24 +08:00
public override void ConfigureServices(ServiceConfigurationContext context)
2024-10-30 17:49:05 +08:00
{
2024-11-12 18:18:43 +08:00
context.Services.AddSingleton<IMongoContext, MongoContext>();
context.Services.AddSingleton<IUnitOfWork, UnitOfWork>();
context.Services.AddSingleton(typeof(IMongoRepository<>), typeof(MongoBaseRepository<>));
2024-11-13 17:50:52 +08:00
Configure<AbpClockOptions>(options =>
{
options.Kind = DateTimeKind.Local;
});
2024-10-30 17:49:05 +08:00
}
}
}