public ConfidentialUserInfoRepository(string nameOrConnectionString, IEntitiesEncryptionService encryptionService, string sharedCryptoIv) { if (encryptionService == null) { throw new ArgumentNullException(nameof(encryptionService)); } _dbContext = new ConfidentialUserInfoDbContext(nameOrConnectionString, encryptionService, sharedCryptoIv); }
public ConfidentialUserInfoDbContext(string nameOrConnectionString, IEntitiesEncryptionService encryptionService, string encryptionIv) : base(nameOrConnectionString) { if (encryptionService == null) { throw new ArgumentNullException(nameof(encryptionService)); } _encryptionService = encryptionService; _encryptionIv = encryptionIv; ((IObjectContextAdapter)this).ObjectContext.ObjectMaterialized += ObjectMaterialized; }