Entity Framework Core で 新規作成 / 更新 / 削除

● Entity Framework Core で 新規作成 / 更新 / 削除

・削除

using (var context = new ShoppingContext())
{
    var product = context.Products.Single(x => x.Name == "Test");
    context.Products.Remove(product); // 削除
    context.Remove(product); // 削除(こちらでもOK)
    context.SaveChanges(); // 削除の適用
}

関連エントリー

No.1941
01/14 08:22

edit

EntityFrameworkCore