Skip to content

10.2 release notes

InfoCarrier.Core 10.2 sends less data over the wire, fixes three ways a save could lose data, and adds server options for transactions and document databases. It needs Entity Framework Core 10.0.1 or later. Upgrade the client and the server together, and read Queries that now throw first.

Less data over the wire

Some queries made the database return every matching row, and the client picked the answer out of them. Measured with 500 orders, where Format.Money stands for any method of your own:

// 10.1.1 read 494 rows. 10.2 reads 1.
await context.Orders.Where(o => o.Freight > 10)
    .Select(o => new { o.Id, o.Freight }).FirstAsync();

// 10.1.1 read 100 rows. 10.2 reads 1.
await context.Orders.Where(o => o.Year == 2023)
    .Select(o => new OrderSummary { Id = o.Id, Freight = o.Freight }).FirstOrDefaultAsync();

// 10.1.1 read 500 rows. 10.2 reads 1.
await context.Orders.OrderBy(o => o.Id)
    .Select(o => new { o.Id, o.Freight }).LastAsync();

// 10.1.1 read 500 rows. 10.2 reads 10.
await context.Orders.OrderBy(o => o.Id)
    .Select(o => new { o.Id, Label = Format.Money(o.Freight) }).Skip(20).Take(10).ToListAsync();

// 10.1.1 read 500 rows. 10.2 counts in the database.
await context.Orders
    .Select(o => new { o.Id, Label = Format.Money(o.Freight) }).CountAsync();

Fixed in #116 and #172. Paging after a Select that only copies columns already ran in the database. ToQueryString() no longer runs the query (#169).

Saves that could lose data

Each of these now behaves as it does with EF Core:

  • A save that changed only an owned type skipped the concurrency check (#115).
  • A save wrote every member of a complex property, and overwrote other users' changes to it (#115).
  • Two contexts running the same query at once could track the wrong entities, and a later save could write nothing and report success (#109).

Server options

Each is off until you call it. See Server configuration.

  • AddInfoCarrierServerTransactionTimeout rolls back a transaction left idle too long (#54).
  • AddInfoCarrierHttpCallerIdentity refuses a transaction token that another caller opened (#54).
  • AddInfoCarrierServerDocumentStore stops a save from erasing the parts of a document it did not mention, on MongoDB, Cosmos DB and similar databases (#103).

Queries that now throw

EF Core refuses these queries, and 10.1 answered them on the client. They now throw EF Core's own exception:

  • Contains over a local list of objects, such as keys.Contains(new { o.Id, o.Year }). A list of numbers or strings still works (#178).
  • On SQLite, a collection inside a Select that applies Distinct without its key, or reads the parent inside it (#149, #152).
  • A compiled query that calls Count() on its list parameter, an EF Core 10 defect (dotnet/efcore#37370). Pass the count as its own parameter (#141).
  • OrderBy on a value of your own that a Select carried along (#148).

If you need one of them, read the rows with ToListAsync() and finish in memory.

Other fixes

Geometry values work on a SQLite server with NetTopologySuite (#176). A synchronous SaveChanges calls the synchronous concurrency interceptor (#175). A value converter for a reflection type such as MethodInfo now needs that type registered (#153).

How it is verified

Total tests: 29958, Failed: 0

Every relational test also ran with plain EF Core on the same database, and the two were compared (#167). That comparison found most of these fixes, and still shows 20 test methods where the two differ.

Feedback

If you encounter a bug, have a question, or would like to request a feature, open an issue.