private static void ConfigureForLocalFileSystem(ContainerBuilder builder, IGalleryConfigurationService configuration) { builder.RegisterType <FileSystemFileStorageService>() .AsSelf() .As <IFileStorageService>() .SingleInstance(); builder.RegisterInstance(NullReportService.Instance) .AsSelf() .As <IReportService>() .SingleInstance(); builder.RegisterInstance(NullStatisticsService.Instance) .AsSelf() .As <IStatisticsService>() .SingleInstance(); // Setup auditing var auditingPath = Path.Combine( FileSystemFileStorageService.ResolvePath(configuration.Current.FileStorageDirectory), FileSystemAuditingService.DefaultContainerName); builder.RegisterInstance(new FileSystemAuditingService(auditingPath, FileSystemAuditingService.GetAspNetOnBehalfOf)) .AsSelf() .As <AuditingService>() .SingleInstance(); // If we're not using azure storage, then aggregate stats comes from SQL builder.RegisterType <SqlAggregateStatsService>() .AsSelf() .As <IAggregateStatsService>() .InstancePerLifetimeScope(); }
private static IAuditingService GetAuditingServiceForLocalFileSystem(IGalleryConfigurationService configuration) { var auditingPath = Path.Combine( FileSystemFileStorageService.ResolvePath(configuration.Current.FileStorageDirectory), FileSystemAuditingService.DefaultContainerName); return(new FileSystemAuditingService(auditingPath, AuditActor.GetAspNetOnBehalfOfAsync)); }