Concurrency on JSON types - System.InvalidOperationException when reading JSON
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
System.InvalidOperationException
Cannot get the value of a token type 'Null' as a string.
at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
at lambda_method2006(Closure, QueryContext, Object[], JsonReaderData)
at lambda_method2005(Closure, QueryContext, DbDataReader, ResultContext, SingleQueryResultCoordinator)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
public class Foo
{
public required Foo2 Foo2{ get; init; }
public required string Bar{ get; init; }
}
public class Foo2
{
...
}
builder.OwnsOne(m => m.Foo).ToJson().OwnsOne(foo=> foo.Foo2);
{..., "_TableSharingConcurrencyTokenConvention_RowVersion":null,"Foo2":{..., "_TableSharingConcurrencyTokenConvention_RowVersion":null}}
Contributor guide
Assessment
This issue has not been assessed yet.