public ICrypt GetCrypt(string storageName, EncryptionSettings encryptionSettings) { ICrypt result = null; using var scope = Container.BeginLifetimeScope(); if (scope != null) { result = scope.Resolve <ICrypt>(); } result ??= new FakeCrypt(); result.Init(storageName, encryptionSettings); return(result); }
public ICrypt GetCrypt(string storageName, EncryptionSettings encryptionSettings) { ICrypt result = null; using var scope = ServiceProvider.CreateScope(); if (scope != null) { result = scope.ServiceProvider.GetService <ICrypt>(); } result ??= new FakeCrypt(); result.Init(storageName, encryptionSettings); return(result); }