aboutsummaryrefslogtreecommitdiff
path: root/docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-12-12 20:30:55 +0800
committercrupest <crupest@outlook.com>2022-12-20 20:32:53 +0800
commit81f9571072a7978fe8b65dd9645d30e351138acd (patch)
tree5612df6f003faeb2b39c063c7fb3b09c7acb7e4a /docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs
parent334cb17d14f003d58e36137eddaac55cacb7ec23 (diff)
downloadcrupest-81f9571072a7978fe8b65dd9645d30e351138acd.tar.gz
crupest-81f9571072a7978fe8b65dd9645d30e351138acd.tar.bz2
crupest-81f9571072a7978fe8b65dd9645d30e351138acd.zip
Develop secret api. v31
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs')
-rw-r--r--docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs28
1 files changed, 0 insertions, 28 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs
index 8c4b34d..60b18e4 100644
--- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs
+++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Json.cs
@@ -5,34 +5,6 @@ namespace CrupestApi.Commons;
public static class CrupestApiJsonExtensions
{
- public static object? CheckJsonValueNotArrayOrObject(this JsonElement value)
- {
- if (value.ValueKind == JsonValueKind.Null && value.ValueKind == JsonValueKind.Undefined)
- {
- return null;
- }
- else if (value.ValueKind == JsonValueKind.True)
- {
- return true;
- }
- else if (value.ValueKind == JsonValueKind.False)
- {
- return false;
- }
- else if (value.ValueKind == JsonValueKind.Number)
- {
- return value.GetDouble();
- }
- else if (value.ValueKind == JsonValueKind.String)
- {
- return value.GetString();
- }
- else
- {
- throw new Exception("Only value not array or object is allowed.");
- }
- }
-
public static IServiceCollection AddJsonOptions(this IServiceCollection services)
{
services.AddOptions<JsonSerializerOptions>();