为什么entity Framework不接受DeleteObject命令?

时间:2014-08-28 18:18:17

标签: c# entity-framework

public JsonResult DeleteAjax(int id)
    {
        Product data = (from product in _db.Product
                        where product.Id == id
                        select product).SingleOrDefault();
        _db.Product.DeleteObject(data);
        _db.SaveChanges();
        return Json("Product deleted succsesfully");
    }

VS无法识别DeleteObject()。为什么不呢?

0 个答案:

没有答案