diff --git a/src/EFCore.Cosmos/Storage/Internal/ByteArrayConverter.cs b/src/EFCore.Cosmos/Storage/Internal/ByteArrayConverter.cs index 75ca94f1a4e..fe63cd57d67 100644 --- a/src/EFCore.Cosmos/Storage/Internal/ByteArrayConverter.cs +++ b/src/EFCore.Cosmos/Storage/Internal/ByteArrayConverter.cs @@ -51,7 +51,7 @@ public override void WriteJson( public override object ReadJson( JsonReader reader, Type objectType, - object existingValue, + object? existingValue, JsonSerializer serializer) { if (reader.TokenType != JsonToken.StartArray) diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs index 7eeb334862f..a5c89b6b37d 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs @@ -359,7 +359,7 @@ private static async Task CreateItemOnceAsync( response.Diagnostics.GetClientElapsedTime(), response.Headers.RequestCharge, response.Headers.ActivityId, - parameters.Document["id"].ToString(), + parameters.Document["id"]!.ToString(), parameters.ContainerId, partitionKeyValue); diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs index 4eed39b426f..0fa8e4e7025 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs @@ -246,7 +246,7 @@ private bool Save(IUpdateEntry entry) if (propertyName != null) { document[propertyName] = - JToken.FromObject(entityType.GetDiscriminatorValue(), CosmosClientWrapper.Serializer); + JToken.FromObject(entityType.GetDiscriminatorValue()!, CosmosClientWrapper.Serializer); } } @@ -377,7 +377,7 @@ private Task SaveAsync(IUpdateEntry entry, CancellationToken cancellationT if (propertyName != null) { document[propertyName] = - JToken.FromObject(entityType.GetDiscriminatorValue(), CosmosClientWrapper.Serializer); + JToken.FromObject(entityType.GetDiscriminatorValue()!, CosmosClientWrapper.Serializer); } } diff --git a/src/EFCore.Cosmos/Storage/Internal/JsonCosmosSerializer.cs b/src/EFCore.Cosmos/Storage/Internal/JsonCosmosSerializer.cs index 9028cd3b0e6..291e6747e20 100644 --- a/src/EFCore.Cosmos/Storage/Internal/JsonCosmosSerializer.cs +++ b/src/EFCore.Cosmos/Storage/Internal/JsonCosmosSerializer.cs @@ -28,7 +28,7 @@ public override T FromStream(Stream stream) using var streamReader = new StreamReader(stream); using var jsonTextReader = new JsonTextReader(streamReader); - return GetSerializer().Deserialize(jsonTextReader); + return GetSerializer().Deserialize(jsonTextReader)!; } }