Publish from private repository

This commit is contained in:
Gitea Actions
2026-08-01 12:08:49 +00:00
commit 6f7fd61ee9
695 changed files with 69563 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
namespace MyOffice.Core.Helpers
{
using System.Text.Json;
using System.Text.Json.Serialization;
public static class JsonHelper
{
public static string ToJson(this object entity, JsonSerializerOptions? options = null)
{
options ??= new JsonSerializerOptions
{
MaxDepth = 0,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
ReferenceHandler = ReferenceHandler.IgnoreCycles,
WriteIndented = true,
};
return JsonSerializer.Serialize(entity, options);
}
}
/*public class CustomIgnoreReferenceHandler : ReferenceHandler
{
//public CustomIgnoreReferenceHandler() => HandlingStrategy = ReferenceHandlingStrategy.IgnoreCycles;
public CustomIgnoreReferenceHandler()
{
new HandlingStrategy { } = true;
}
public override ReferenceResolver CreateResolver() => new IgnoreReferenceResolver();
}*/
}