public FileController( IUploadStorageProvider storageProvider, ICrudService crudService, ILogger <FileController> logger ) { _storageProvider = storageProvider; _crudService = crudService; _logger = logger; }
public CrudService( LactalisDBContext dbContext, UserManager <User> userManager, ISecurityService securityService, IIdentityService identityService, ILogger <CrudService> logger, IServiceProvider serviceProvider, IUploadStorageProvider storageProvider, IUserService userService, IAuditService auditService) { _dbContext = dbContext; _userManager = userManager; _securityService = securityService; _identityService = identityService; _logger = logger; _serviceProvider = serviceProvider; _storageProvider = storageProvider; _userService = userService; _auditService = auditService; }
public GraphqlFileTests() { _host = ServerBuilder.CreateServer(new ServerBuilderOptions { ConfigureServices = (collection, options) => { collection.AddScoped <IUploadStorageProvider, InMemoryFileProvider>(); } }); var serviceProvider = _host.Services.CreateScope().ServiceProvider; var httpContextAccessor = serviceProvider.GetRequiredService <IHttpContextAccessor>(); _dbContext = serviceProvider.GetRequiredService <LactalisDBContext>(); _storageProvider = serviceProvider.GetRequiredService <IUploadStorageProvider>(); _crudService = serviceProvider.GetRequiredService <ICrudService>(); _graphqlService = serviceProvider.GetRequiredService <IGraphQlService>(); _identityService = serviceProvider.GetRequiredService <IIdentityService>(); _fileController = serviceProvider.GetRequiredService <FileController>(); _fileController.ControllerContext.HttpContext = httpContextAccessor.HttpContext; }