Rowversion comparison in Entity Framework

前端 未结 3 2132
温柔的废话
温柔的废话 2021-02-14 22:31

How should I compare rowversion fields using Entity Framework? I have one table which has a rowversion column, I want to get data from tables for which

3条回答
  •  梦谈多话
    2021-02-14 23:02

    Use EntitySQL.

    // Drop down to ObjectContext and query against ObjectSet:
    var objectContext = (dbContext as IObjectContextAdapter).ObjectContext;
    // Create param for EntitySQL
    var param = new ObjectParameter("rowVersion", rowVersion);
    // Create IQueryable
    var query = objectContext.CreateObjectSet.Where("it.RowVersion > @rowVersion",param);
    

提交回复
热议问题