Compare commits
No commits in common. "e20608ade90b9d43871445a8cdcf0080fe2cf1db" and "e3917c00362a47928a588b4d3c160830f7051101" have entirely different histories.
e20608ade9
...
e3917c0036
|
|
@ -12,7 +12,6 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
|
||||||
<PackageReference Include="MessagePack" Version="2.5.168" />
|
<PackageReference Include="MessagePack" Version="2.5.168" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ public static class SerializeObjectExtensions
|
||||||
{
|
{
|
||||||
private static readonly JsonSerializerSettings Options = new()
|
private static readonly JsonSerializerSettings Options = new()
|
||||||
{
|
{
|
||||||
//TypeNameHandling = TypeNameHandling.All,
|
|
||||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||||
NullValueHandling = NullValueHandling.Ignore
|
NullValueHandling = NullValueHandling.Ignore
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,54 +3,19 @@ using MessagePack;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using AyCode.Core.Interfaces;
|
using AyCode.Core.Interfaces;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq.Expressions;
|
|
||||||
|
|
||||||
namespace AyCode.Services.SignalRs;
|
namespace AyCode.Services.SignalRs;
|
||||||
|
|
||||||
public class IdMessage
|
public class IdMessage
|
||||||
{
|
{
|
||||||
public List<string> Ids { get; private set; } = [];
|
public List<Guid> Ids { get; private set; } = [];
|
||||||
|
|
||||||
public IdMessage()
|
public IdMessage()
|
||||||
|
{}
|
||||||
|
|
||||||
|
public IdMessage(params Guid[] ids) : this()
|
||||||
{
|
{
|
||||||
}
|
Ids.AddRange(ids);
|
||||||
|
|
||||||
public IdMessage(IEnumerable<object> ids) : this()
|
|
||||||
{
|
|
||||||
//Ids.AddRange(ids);
|
|
||||||
Ids.AddRange(ids.Select(x =>
|
|
||||||
{
|
|
||||||
string item;
|
|
||||||
|
|
||||||
//if (x is Expression expr)
|
|
||||||
//{
|
|
||||||
// string aa = string.Empty;
|
|
||||||
// var serializer = new ExpressionSerializer(new JsonSerializer());
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// aa = serializer.SerializeText(expr);
|
|
||||||
// }
|
|
||||||
// catch(Exception ex)
|
|
||||||
// {
|
|
||||||
// Console.WriteLine(ex);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// item = (new[] { aa }).ToJson();
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
item = (new[] { x }).ToJson();
|
|
||||||
|
|
||||||
return item;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public IdMessage(object id) : this(new object[] { id })
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public IdMessage(IEnumerable<Guid> ids) : this(ids.Cast<object>().ToArray())
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue