mirror of https://github.com/Squidex/squidex.git
7 changed files with 104 additions and 37 deletions
@ -0,0 +1,30 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
namespace Squidex.Infrastructure.Json.Objects |
|||
{ |
|||
public sealed class JsonBoolean : JsonScalar<bool> |
|||
{ |
|||
public static readonly JsonBoolean True = new JsonBoolean(true); |
|||
public static readonly JsonBoolean False = new JsonBoolean(false); |
|||
|
|||
public override JsonValueType Type |
|||
{ |
|||
get { return JsonValueType.Boolean; } |
|||
} |
|||
|
|||
private JsonBoolean(bool value) |
|||
: base(value) |
|||
{ |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return Value ? "true" : "false"; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
namespace Squidex.Infrastructure.Json.Objects |
|||
{ |
|||
public sealed class JsonNumber : JsonScalar<double> |
|||
{ |
|||
public override JsonValueType Type |
|||
{ |
|||
get { return JsonValueType.Number; } |
|||
} |
|||
|
|||
internal JsonNumber(double value) |
|||
: base(value) |
|||
{ |
|||
} |
|||
|
|||
public override string ToJsonString() |
|||
{ |
|||
return $"{Value}"; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
namespace Squidex.Infrastructure.Json.Objects |
|||
{ |
|||
public sealed class JsonString : JsonScalar<string> |
|||
{ |
|||
public override JsonValueType Type |
|||
{ |
|||
get { return JsonValueType.String; } |
|||
} |
|||
|
|||
internal JsonString(string value) |
|||
: base(value) |
|||
{ |
|||
} |
|||
|
|||
public override string ToJsonString() |
|||
{ |
|||
return $"\"{Value}\""; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue