29 lines
825 B
C#
29 lines
825 B
C#
using Cassandra;
|
|
using Cassandra.Mapping;
|
|
using JiShe.CollectBus.Cassandra.Mappers;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp;
|
|
using Volo.Abp.Autofac;
|
|
using Volo.Abp.Modularity;
|
|
|
|
namespace JiShe.CollectBus.Cassandra
|
|
{
|
|
[DependsOn(
|
|
typeof(AbpAutofacModule)
|
|
)]
|
|
public class CollectBusCassandraModule : AbpModule
|
|
{
|
|
public override Task ConfigureServicesAsync(ServiceConfigurationContext context)
|
|
{
|
|
Configure<CassandraConfig>(context.Services.GetConfiguration().GetSection("Cassandra"));
|
|
context.AddCassandra();
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
|
{
|
|
await context.UseCassandra();
|
|
}
|
|
}
|
|
}
|