18 lines
604 B
C#
18 lines
604 B
C#
using JiShe.CollectBus.Common.Interfaces;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using MongoDB.Driver;
|
|
|
|
namespace JiShe.CollectBus.MongoDB
|
|
{
|
|
public class JiSheCollectBusMongoDbModule: IJiSheModule
|
|
{
|
|
public void ConfigureServices(IServiceCollection services, HostBuilderContext hostContext)
|
|
{
|
|
services.AddSingleton<IMongoContext, MongoContext>();
|
|
services.AddSingleton<IUnitOfWork, UnitOfWork>();
|
|
services.AddSingleton(typeof(IMongoRepository<>), typeof(MongoBaseRepository<>));
|
|
}
|
|
}
|
|
}
|