using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EasyDevCore.Common.Security;
using Microsoft.Extensions.Configuration;
namespace EasyDevCore.Configuration
{
///
///
///
///
public class ProtectDataConfigurationSource : IConfigurationSource
{
private readonly IConfigurationRoot _configurationRoot;
///
/// The decrypt function
///
private readonly Func _decryptFunc;
private readonly Func _encryptFunc;
///
/// Initializes a new instance of the class.
///
/// The configuration root.
/// The decrypt function.
/// The encrypt function.
public ProtectDataConfigurationSource(IConfigurationRoot configurationRoot, Func encryptFunc, Func decryptFunc)
{
_configurationRoot = configurationRoot;
_decryptFunc = decryptFunc;
_encryptFunc = encryptFunc;
}
///
/// Builds the for this source.
///
/// The .
///
/// An
///
public IConfigurationProvider Build(IConfigurationBuilder builder)
{
return new ProtectDataConfigurationProvider(_configurationRoot, _decryptFunc, _encryptFunc);
}
}
}