namespace Admin.NET.Core.Service;
///
/// 表名映射
///
public class TableMapper : ITransient
{
private readonly Dictionary _options = new Dictionary(StringComparer.OrdinalIgnoreCase);
public TableMapper(IOptions> options)
{
foreach (var item in options.Value)
{
_options.Add(item.Key, item.Value);
}
}
///
/// 获取表别名
///
///
///
public string GetTableName(string oldname)
{
if (_options.ContainsKey(oldname))
{
return _options[oldname];
}
return oldname;
}
}