cyqdata icon indicating copy to clipboard operation
cyqdata copied to clipboard

SQLite 数据库 OrmBase ToList “<ID>k__BackingField”

Open eatl104 opened this issue 3 years ago • 1 comments

远程处理无法在类型“GSCSClient.TransportStatus”上找到字段“<ID>k__BackingField”。 CYQ.Data.AppConfig.SetConn("Conn", @"Data Source=gscs.db;failifmissing=false;");

using System; using CYQ.Data.Orm; namespace GSCSClient { public class TransportStatus : OrmBase { public TransportStatus() { base.SetInit(this, "transport_status", "Conn"); } public int ID { get; set; } public int Type { get; set; } public string Date { get; set; } public string Username { get; set; } public string GID { get; set; } public string Hash { get; set; } public string Hashfile { get; set; } public string Status { get; set; } public string Name { get; set; } public string Progress { get; set; } public string Upfiles { get; set; } public string Downloadspeed { get; set; } public string Uploadspeed { get; set; } public string Size { get; set; } public string Upsize { get; set; } public string Show { get; set; } } } using (MAction action = new MAction("transport_status"))

        {
            //查询数据格式

            

            action.Select().ToList< TransportStatus >();//直接查询 泛型实体


        }

       
        TransportStatus taskInfo = new TransportStatus();
        MDataTable md = taskInfo.Select("username ='" + AppContext.User + "'");
        List< TransportStatus> transportsList =md.ToList<TransportStatus>();

只要ToList 都会报错,可以插入数据

eatl104 avatar Aug 04 '21 16:08 eatl104

670:修正:MDataTable.ToList<T> T为继承自OrmBase的问题。(2021-08-05)【V5.8.4.5】 新版本已进行了优化,用实体时用对应的Orm类:DBFast或Orm的的Select,性能更好。

cyq1162 avatar Aug 05 '21 04:08 cyq1162