rama creada apartir de master en j
This commit is contained in:
@@ -4,6 +4,9 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace adas_core.Domain.Models.SignalR;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a message, typically used for communication or data transfer between components.
|
||||
/// </summary>
|
||||
public class Message
|
||||
{
|
||||
public long IdMessage { get; set; }
|
||||
@@ -23,16 +26,20 @@ public class Message
|
||||
public SubscriptionEnum.Type Operation { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a JSON representation of the current object, falling back to the default <see cref="object.ToString"/> implementation if serialization fails.
|
||||
/// </summary>
|
||||
/// <returns>A JSON-formatted string describing the object, or the result of the base <see cref="object.ToString"/> method if serialization throws an exception.</returns>
|
||||
public override string? ToString()
|
||||
{
|
||||
try
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.None,
|
||||
new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
|
||||
try
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.None,
|
||||
new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
|
||||
}
|
||||
catch
|
||||
{
|
||||
return base.ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return base.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user