EF4 Update Entity Without First Getting Entity

前端 未结 3 2025
Happy的楠姐
Happy的楠姐 2020-12-31 10:33

How can I update an entity without having to make a call to select it. If I supply the key for the entity, should it not know to update after SaveChanges() is called on the

3条回答
  •  清酒与你
    2020-12-31 11:26

    Didn't you have to select it anyway to get it's data to edit? If you cache it it won't cost you anything getting it again when you save it.

提交回复
热议问题