2009-10-02 28 views

回答

2

所有我發現,差點產生這樣的庫是這樣的博客:Batch Updates and Deletes with LINQ to SQL

這是朝着正確方向邁出的一步IMO

編輯: 關於關於GetDeleteBatchCommand該註釋。它在源代碼中。這裏有一個代碼:

private static DbCommand GetDeleteBatchCommand<TEntity>(this Table<TEntity> table, IQueryable<TEntity> entities) where TEntity : class 
    { 
     var deleteCommand = table.Context.GetCommand(entities); 
     deleteCommand.CommandText = string.Format("DELETE {0}\r\n", table.GetDbName()) + GetBatchJoinQuery<TEntity>(table, entities); 
     return deleteCommand; 
    } 
+0

這篇文章採用的是不存在的方法「GetDeleteBatchCommand」,這是無用的,除非我找到它實現 – 2009-10-02 21:00:57

+0

這是一個擴展?或者它是.net框架的一部分? – 2009-10-06 11:29:22

+0

這是一個使用Expression和Extensions的擴展。我相信你可以聯繫這個人或者圍繞UpdateBatch構建一些東西。它寫得很好,甚至有一些評論! Mathlec 2009-10-06 11:51:58

相關問題