Pārlūkot izejas kodu

Fixed serialized the message type bug. (#53)

master
Savorboard pirms 7 gadiem
vecāks
revīzija
133ef01bf9
1 mainītis faili ar 10 papildinājumiem un 2 dzēšanām
  1. +10
    -2
      src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs

+ 10
- 2
src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs Parādīt failu

@@ -68,10 +68,18 @@ namespace DotNetCore.CAP.Abstractions

protected virtual string Serialize<T>(T obj, string callbackName = null)
{
var serializer = (IContentSerializer)ServiceProvider.GetService(typeof(IContentSerializer));
var packer = (IMessagePacker)ServiceProvider.GetService(typeof(IMessagePacker));

var content = serializer.Serialize(obj);
string content = string.Empty;
if (Helper.IsComplexType(obj.GetType()))
{
var serializer = (IContentSerializer)ServiceProvider.GetService(typeof(IContentSerializer));
content = serializer.Serialize(obj);
}
else
{
content = obj?.ToString();
}

var message = new CapMessageDto(content)
{


Notiek ielāde…
Atcelt
Saglabāt