linq2db,使用DataConnection作为抽象类

我正在尝试像这样在抽象基类中使用DataConnection的{​​{1}}类:

linq2db

然后我从另一个类中调用它,

public abstract class BaseDbdao<T> : DataConnection where T : IDatabase
{
    public string DBName => DBContext.Database;
    public T DBContext { get; }

    public DataConnection GetDataConnection()
    {
        return (this);
    }

    internal BaseDbdao(RelativityHelper helper,int workspaceId)
        : base(GetDataProvider(),helper.GetDBContextNew(workspaceId).getconnection())
    {
        DBContext = (T)helper.GetDBContextNew(workspaceId);
    }

    public static IDataProvider GetDataProvider()
    {
        LinqToDB.Common.Configuration.AvoidSpecificDataProviderAPI = true;
        return new SqlServerDataProvider("",SqlServerVersion.v2017);
    }
}

但是,我似乎无法将public class EdMeDbdao : BaseDbdao<MSSQLDBContext> { public ITable<EdMetableRow> EdMeDatabase => GetTable<EdMetableRow>(); public EdMeDbdao(RelativityHelper helper) : base(helper,"123456") { } public List<RelativityWorkspace> GetactiveProjects() { using (var db = GetDataConnection()) { var a = GetTable<EdMetableRow>().CaseName }; } } 称为var a = GetTable<EdMetableRow>().CaseName

ITable<EdMetableRow> does not contain a definition for 'CaseName'定义为:

EdMetableRow

如何从[Table(Name = "NuixWorkflowCases",Schema = "dbo")] public class EdMetableRow { public string CaseName { get; set; } } 类访问EdMetableRow类?

iCMS 回答:linq2db,使用DataConnection作为抽象类

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2163279.html

大家都在问