【发布时间】:2020-04-07 13:50:06
【问题描述】:
我想要使用 linq2db.EntityFrameworkCore 对所有表进行通用查询
我有 5 件事。 1. 表名 2. 列名 3. 列值 4. where条件列名 5.where条件列值。
到目前为止,我实际上正在尝试的内容如下所示。
public void update(string entity, string attribute, object value, string whereAttribute, string whereAttributeValue)
{
projectContext.Set<object>().ToLinqToDBTable().TableName(entity)
.Where(t => t[whereAttribute] == whereAttributeValue) // This is not working.
.Set(t => t[attribute], value) // so far it is not giving any build error.
.Update();
}
但它不起作用。如何解决这个问题?
【问题讨论】:
标签: c# entity-framework linq entity-framework-core linq2db