JiShe.CollectBus/JiShe.CollectBus.MongoDB/JiSheCollectBusMongoDBModule.cs
2024-11-13 17:50:52 +08:00

30 lines
944 B
C#

using JiShe.CollectBus.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.Timing;
namespace JiShe.CollectBus.MongoDB
{
[DependsOn(typeof(AbpTimingModule),
typeof(JiSheCollectBusEntityFrameworkCoreModule))]
public class JiSheCollectBusMongoDbModule: AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddSingleton<IMongoContext, MongoContext>();
context.Services.AddSingleton<IUnitOfWork, UnitOfWork>();
context.Services.AddSingleton(typeof(IMongoRepository<>), typeof(MongoBaseRepository<>));
Configure<AbpClockOptions>(options =>
{
options.Kind = DateTimeKind.Local;
});
}
}
}