2352306269
* add ability for objectloader to skip server too. add test so both cache and server can't be skipped * move testing project to correct dir * remove extra file
25 lines
705 B
C#
25 lines
705 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Argon;
|
|
using Speckle.Sdk.Common;
|
|
using Speckle.Sdk.Serialisation;
|
|
|
|
namespace Speckle.Sdk.Testing.Framework;
|
|
|
|
[SuppressMessage("Design", "CA1062:Validate arguments of public methods")]
|
|
public class IdStringSerializer : JsonConverter
|
|
{
|
|
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
|
{
|
|
var id = (Id)value;
|
|
writer.WriteValue(id.Value);
|
|
}
|
|
|
|
public override object? ReadJson(JsonReader reader, Type type, object? existingValue, JsonSerializer serializer)
|
|
{
|
|
var json = reader.ReadAsString();
|
|
return new Id(json.NotNull());
|
|
}
|
|
|
|
public override bool CanConvert(Type type) => typeof(Id) == type;
|
|
}
|