diff --git a/src/JanusGraph.Net/IO/GraphBinary/JanusGraphTypeSerializerRegistry.cs b/src/JanusGraph.Net/IO/GraphBinary/JanusGraphTypeSerializerRegistry.cs index 0ac8ba6..48be44e 100644 --- a/src/JanusGraph.Net/IO/GraphBinary/JanusGraphTypeSerializerRegistry.cs +++ b/src/JanusGraph.Net/IO/GraphBinary/JanusGraphTypeSerializerRegistry.cs @@ -37,7 +37,7 @@ public static class JanusGraphTypeSerializerRegistry /// public static readonly TypeSerializerRegistry Instance = Build().Create(); - private static Builder Build() => new Builder(); + private static Builder Build() => new(); /// /// Builds a with serializers for JanusGraph types already registered. diff --git a/src/JanusGraph.Net/IO/GraphBinary/Types/JanusGraphTypeSerializer.cs b/src/JanusGraph.Net/IO/GraphBinary/Types/JanusGraphTypeSerializer.cs index 9180952..4ce3590 100644 --- a/src/JanusGraph.Net/IO/GraphBinary/Types/JanusGraphTypeSerializer.cs +++ b/src/JanusGraph.Net/IO/GraphBinary/Types/JanusGraphTypeSerializer.cs @@ -43,7 +43,7 @@ protected JanusGraphTypeSerializer(GraphBinaryType type) } /// - public override async Task WriteAsync(object value, Stream stream, GraphBinaryWriter writer, + public override async Task WriteAsync(object? value, Stream stream, GraphBinaryWriter writer, CancellationToken cancellationToken = default) { await stream.WriteIntAsync(_type.TypeId, cancellationToken).ConfigureAwait(false); @@ -52,7 +52,7 @@ public override async Task WriteAsync(object value, Stream stream, GraphBinaryWr } /// - public override async Task WriteNullableValueAsync(object value, Stream stream, GraphBinaryWriter writer, + public override async Task WriteNullableValueAsync(object? value, Stream stream, GraphBinaryWriter writer, CancellationToken cancellationToken = default) { if (value == null) @@ -90,7 +90,7 @@ protected abstract Task WriteNonNullableValueInternalAsync(object value, Stream GraphBinaryWriter writer, CancellationToken cancellationToken = default); /// - public override async Task ReadAsync(Stream stream, GraphBinaryReader reader, + public override async Task ReadAsync(Stream stream, GraphBinaryReader reader, CancellationToken cancellationToken = default) { var customTypeInfo = await stream.ReadIntAsync(cancellationToken).ConfigureAwait(false); @@ -104,7 +104,7 @@ public override async Task ReadAsync(Stream stream, GraphBinaryReader re } /// - public override async Task ReadNullableValueAsync(Stream stream, GraphBinaryReader reader, + public override async Task ReadNullableValueAsync(Stream stream, GraphBinaryReader reader, CancellationToken cancellationToken = default) { var valueFlag = await stream.ReadByteAsync(cancellationToken).ConfigureAwait(false); diff --git a/src/JanusGraph.Net/IO/GraphBinary/Types/RelationIdentifierSerializer.cs b/src/JanusGraph.Net/IO/GraphBinary/Types/RelationIdentifierSerializer.cs index fcfe407..0f821fa 100644 --- a/src/JanusGraph.Net/IO/GraphBinary/Types/RelationIdentifierSerializer.cs +++ b/src/JanusGraph.Net/IO/GraphBinary/Types/RelationIdentifierSerializer.cs @@ -109,7 +109,7 @@ public override async Task ReadNonNullableValueAsync(Stream stream, var relationId = await stream.ReadLongAsync(cancellationToken).ConfigureAwait(false); var inVertexIdMarker = await stream.ReadByteAsync(cancellationToken).ConfigureAwait(false); - object inVertexId; + object? inVertexId; if (inVertexIdMarker == StringMarker) { inVertexId = await ReadStringAsync(stream, cancellationToken).ConfigureAwait(false); diff --git a/src/JanusGraph.Net/IO/GraphSON/JanusGraphGraphSONMessageSerializer.cs b/src/JanusGraph.Net/IO/GraphSON/JanusGraphGraphSONMessageSerializer.cs index dea358b..992f694 100644 --- a/src/JanusGraph.Net/IO/GraphSON/JanusGraphGraphSONMessageSerializer.cs +++ b/src/JanusGraph.Net/IO/GraphSON/JanusGraphGraphSONMessageSerializer.cs @@ -60,7 +60,7 @@ public async Task SerializeMessageAsync(RequestMessage requestMessage, } /// - public async Task>> DeserializeMessageAsync(byte[] message, + public async Task>?> DeserializeMessageAsync(byte[] message, CancellationToken cancellationToken = default) { return await _serializer.DeserializeMessageAsync(message, cancellationToken).ConfigureAwait(false); diff --git a/src/JanusGraph.Net/IO/GraphSON/RelationIdentifierDeserializer.cs b/src/JanusGraph.Net/IO/GraphSON/RelationIdentifierDeserializer.cs index 7be317b..08558cb 100644 --- a/src/JanusGraph.Net/IO/GraphSON/RelationIdentifierDeserializer.cs +++ b/src/JanusGraph.Net/IO/GraphSON/RelationIdentifierDeserializer.cs @@ -27,7 +27,7 @@ internal class RelationIdentifierDeserializer : IGraphSONDeserializer { public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader) { - return new RelationIdentifier(graphsonObject.GetProperty("relationId").GetString()); + return new RelationIdentifier(graphsonObject.GetProperty("relationId").GetString()!); } } } \ No newline at end of file diff --git a/src/JanusGraph.Net/JanusGraph.Net.csproj b/src/JanusGraph.Net/JanusGraph.Net.csproj index b364425..20adec6 100644 --- a/src/JanusGraph.Net/JanusGraph.Net.csproj +++ b/src/JanusGraph.Net/JanusGraph.Net.csproj @@ -6,6 +6,8 @@ True True snupkg + 9 + enable 1.0.0-rc2 JanusGraph.Net JanusGraph diff --git a/src/JanusGraph.Net/JanusGraphClientBuilder.cs b/src/JanusGraph.Net/JanusGraphClientBuilder.cs index ebac628..f8a6b76 100644 --- a/src/JanusGraph.Net/JanusGraphClientBuilder.cs +++ b/src/JanusGraph.Net/JanusGraphClientBuilder.cs @@ -37,8 +37,8 @@ public class JanusGraphClientBuilder private readonly GremlinServer _server; private readonly JanusGraphSONReaderBuilder _readerBuilder = JanusGraphSONReaderBuilder.Build(); private readonly JanusGraphSONWriterBuilder _writerBuilder; - private IMessageSerializer _serializer; - private ConnectionPoolSettings _connectionPoolSettings; + private IMessageSerializer? _serializer; + private ConnectionPoolSettings? _connectionPoolSettings; private JanusGraphClientBuilder(GremlinServer server) { diff --git a/src/JanusGraph.Net/JanusGraphP.cs b/src/JanusGraph.Net/JanusGraphP.cs index da7ab83..d7c9467 100644 --- a/src/JanusGraph.Net/JanusGraphP.cs +++ b/src/JanusGraph.Net/JanusGraphP.cs @@ -24,7 +24,7 @@ namespace JanusGraph.Net { internal class JanusGraphP : P { - public JanusGraphP(string operatorName, object value, P other = null) : base(operatorName, value, other) + public JanusGraphP(string operatorName, object? value, P? other = null) : base(operatorName, value, other) { } } diff --git a/src/JanusGraph.Net/RelationIdentifier.cs b/src/JanusGraph.Net/RelationIdentifier.cs index 0f58d36..ffcd375 100644 --- a/src/JanusGraph.Net/RelationIdentifier.cs +++ b/src/JanusGraph.Net/RelationIdentifier.cs @@ -73,7 +73,7 @@ public RelationIdentifier(string stringRepresentation) /// The JanusGraph internal type id. /// The JanusGraph internal relation id. /// The id of the incoming vertex. - public RelationIdentifier(object outVertexId, long typeId, long relationId, object inVertexId) + public RelationIdentifier(object outVertexId, long typeId, long relationId, object? inVertexId) { OutVertexId = outVertexId; TypeId = typeId; @@ -132,10 +132,10 @@ public RelationIdentifier(object outVertexId, long typeId, long relationId, obje /// /// Gets the id of the incoming vertex. /// - public object InVertexId { get; } + public object? InVertexId { get; } /// - public bool Equals(RelationIdentifier other) + public bool Equals(RelationIdentifier? other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; @@ -143,7 +143,7 @@ public bool Equals(RelationIdentifier other) } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; @@ -154,7 +154,7 @@ public override bool Equals(object obj) /// public override int GetHashCode() { - return StringRepresentation != null ? StringRepresentation.GetHashCode() : 0; + return StringRepresentation.GetHashCode(); } ///