using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Reflection;
|
using System.Runtime;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.DAL.Factory
|
{
|
/// <summary>
|
/// 数据访问类
|
/// </summary>
|
public class DataAccess
|
{
|
private const string Remote_DllName = "";
|
private const string Local_DllName = "IStation.DAL.LocalFile.Scene";
|
|
|
private const string Remote_NameSpace = "";
|
private const string Local_NameSpace = "IStation.DAL.LocalFile";
|
|
/// <summary>
|
/// DLL名称
|
/// </summary>
|
private static string DllName
|
{
|
get
|
{
|
/*if (Settings.GlobalParas.IsRemoteMode)
|
{
|
return Remote_DllName;
|
}*/
|
return Local_DllName;
|
}
|
}
|
|
/// <summary>
|
/// 命名控件
|
/// </summary>
|
private static string NameSpace
|
{
|
get
|
{
|
/*if (Settings.GlobalParas.IsRemoteMode)
|
{
|
return Remote_NameSpace;
|
}*/
|
return Local_NameSpace;
|
}
|
}
|
|
|
/// <summary>
|
/// 创建
|
/// </summary>
|
public static I Create<I>()
|
{
|
if (string.IsNullOrEmpty(DllName))
|
{
|
LogHelper.Error($"DAL工厂创建IDAL接口对象失败,请检查相关配置参数!");
|
return default;
|
}
|
|
if (string.IsNullOrEmpty(NameSpace))
|
{
|
LogHelper.Error($"DAL工厂创建IDAL接口对象失败,请检查相关配置参数!");
|
return default;
|
}
|
|
var obj = DataAccessBase.CreateDAL<I>(DllName, NameSpace);
|
return (I)obj;
|
}
|
|
}
|
}
|