Skip to content

Commit

Permalink
Merge pull request #6890 from Particular/databus_newtonsoft_serilaliz…
Browse files Browse the repository at this point in the history
…er_bug_8_1

DataBus changes in NServiceBus 8 do not work with NewtonsoftJsonSerializer
  • Loading branch information
jpalac committed Oct 12, 2023
2 parents 858d028 + 78cdbb5 commit 5b46720
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/NServiceBus.Core/DataBus/DataBusProperty.cs
Expand Up @@ -15,9 +15,8 @@ public class DataBusProperty<T> : IDataBusProperty, ISerializable where T : clas
/// <summary>
/// initializes a <see cref="DataBusProperty{T}" /> with no value set.
/// </summary>
public DataBusProperty() : this(null)
public DataBusProperty()
{
Type = typeof(T);
}

/// <summary>
Expand All @@ -26,11 +25,6 @@ public DataBusProperty() : this(null)
/// <param name="value">The value to initialize with.</param>
public DataBusProperty(T value)
{
if (value != null)
{
Type = typeof(T);
}

SetValue(value);
}

Expand All @@ -57,7 +51,7 @@ protected DataBusProperty(SerializationInfo info, StreamingContext context)
/// The property <see cref="Type" />.
/// </summary>
[JsonIgnore]
public Type Type { get; }
public Type Type { get; } = typeof(T);

/// <summary>
/// The <see cref="IDataBusProperty" /> key.
Expand Down

0 comments on commit 5b46720

Please sign in to comment.