문제

What is the easiest way to support sql server rowversion during update?

I tried this:

db.UpdateOnly(u, f => new { f.Name, f.Description, f.Modified, f.ModifiedBy }, f => f.Version == u.Version && f.Id == u.Id);

but that fails miserably because it compares version as a Varchar(8000), go figure.

Not exactly the same but still a ServiceStack and OrmLite question:

What is the best way to eager load related entity descriptions? I've seen this but noticed the Join changeset being checked in? This has lead to the POCO classes now having additional "Ignored" descriptions for each of the foreign keys.

도움이 되었습니까?

해결책

As RowVersion is a byte[] field, it requires a parameterized support for Updates / Insert which have been added to ServiceStack.OrmLite in v3.9.37.

The Join support is apart of a new Expression builder we're planning on adding to OrmLite, it's not ready yet. For eager loading you can use custom SQL or depending on your query you may be able to join the result sets in-memory using Linq2Objects.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top