2024-10-30 17:49:05 +08:00
|
|
|
|
using JiShe.CollectBus.Common.Interfaces;
|
2024-11-12 18:18:43 +08:00
|
|
|
|
using JiShe.CollectBus.Common.Models;
|
2024-10-30 17:49:05 +08:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
|
|
namespace JiShe.CollectBus.MongoDB
|
|
|
|
|
|
{
|
|
|
|
|
|
public class JiSheCollectBusMongoDbModule: IJiSheModule
|
|
|
|
|
|
{
|
2024-11-12 18:18:43 +08:00
|
|
|
|
public void ConfigureServices(ServiceContext 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-10-30 17:49:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|