在ADO.Net EF 4 CTP 3中查看Code First,並想知道如何處理their walkthrough中的SqlConnection
。這是ContextBuilder的責任嗎?這個例子中是否缺失?EF 4 Code First的ContextBuilder是否處理其SqlConnection?
var connection = new SqlConnection(DB_CONN);
var builder = new ContextBuilder<BloggingModel>();
var connection = new SqlConnection(DB_CONN);
using (var ctx = builder.Create(connection))
{
//...
}
此代碼並不完全是鏈接上的內容,但我認爲這是剪切和粘貼錯誤。 – 2010-06-11 02:50:05
@Craig:爲簡明起見而縮寫...... :-) – 2010-06-11 03:55:08