【发布时间】:2013-04-04 19:28:06
【问题描述】:
对于我的每个表都有 Key 值,所以我的问题是如何获取 Key 属性? 我想搜索我在参数中得到的那个对象,并通过这个更新的对象更新表格。如何从表格中找到我的对象?
public static void Update<TEntity>(TEntity UpdatedObject) where TEntity : class
{
DatabaseLinqDataContext ClientLinq = new DatabaseLinqDataContext(Patch);
ClientLinq.GetTable<TEntity>()// I want to search that object i got in the paramater and update it. how do I find my object from the table?
ClientLinq.SubmitChanges();
}
有什么想法吗?解决这个问题的正确方法是什么?
这个动作写在业务逻辑层中。
【问题讨论】:
-
为什么要重建默认的 linq-to-sql 行为?
标签: c# linq-to-sql business-logic-layer