Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NRT annotations required for the new Newtonsoft.Json version #34470

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EFCore.Cosmos/Storage/Internal/ByteArrayConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private static async Task<bool> CreateItemOnceAsync(
response.Diagnostics.GetClientElapsedTime(),
response.Headers.RequestCharge,
response.Headers.ActivityId,
parameters.Document["id"].ToString(),
parameters.Document["id"]!.ToString(),
parameters.ContainerId,
partitionKeyValue);

Expand Down
4 changes: 2 additions & 2 deletions src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -377,7 +377,7 @@ private Task<bool> SaveAsync(IUpdateEntry entry, CancellationToken cancellationT
if (propertyName != null)
{
document[propertyName] =
JToken.FromObject(entityType.GetDiscriminatorValue(), CosmosClientWrapper.Serializer);
JToken.FromObject(entityType.GetDiscriminatorValue()!, CosmosClientWrapper.Serializer);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Cosmos/Storage/Internal/JsonCosmosSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override T FromStream<T>(Stream stream)

using var streamReader = new StreamReader(stream);
using var jsonTextReader = new JsonTextReader(streamReader);
return GetSerializer().Deserialize<T>(jsonTextReader);
return GetSerializer().Deserialize<T>(jsonTextReader)!;
}
}

Expand Down