Linq To SQL Attach/Refresh Entity Object

前端 未结 2 595
梦如初夏
梦如初夏 2021-01-02 03:56

In Linq To Sql, when updating one of my entities, Faculty, I am creating a new instance of the Faculty object, then initializing some of the properties with values

2条回答
  •  天命终不由人
    2021-01-02 04:27

    Did you try

    context.Refresh(RefreshMode.OverwriteCurrentValues, faculty);

    after submit changes where context is your linq2sql datacontext and faculty is the entity you want to refresh?

提交回复
热议问题