Antigrav 1.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Antigrav --version 1.2.1                
NuGet\Install-Package Antigrav -Version 1.2.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Antigrav" Version="1.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Antigrav --version 1.2.1                
#r "nuget: Antigrav, 1.2.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Antigrav as a Cake Addin
#addin nuget:?package=Antigrav&version=1.2.1

// Install Antigrav as a Cake Tool
#tool nuget:?package=Antigrav&version=1.2.1                

Antigrav

NuGet | Source <br> Serializing library based on JSON format, so its also easy to read format.

Types

  • null
  • string: specified in quotation marks ("")
  • bool: true or false
  • integer: sbyte or byte or short or ushort or int or uint or long or ulong or Int128 or UInt128
  • Enum: encoded as number values
  • floating point number: float or double or decimal
  • Complex
  • IDictionary: specified in curly brackets ({}). Objects are encoded as dictionaries
  • ICollection or ITuple: specified in square brackets ([])

Usage example

using static Antigrav.Main;

private enum Values {
    Ace = 1,
    Two = 2,
    Three = 3,
    Four = 4,
    Five = 5,
    Six = 6,
    Seven = 7,
    Eight = 8,
    Nine = 9,
    Ten = 10,
    Jack = 11,
    Queen = 12,
    King = 13,
}
private enum Suits {
    Diamonds,
    Clubs,
    Hearts,
    Spades,
}
private class Card {
    public Card() {
        Value = null;
        Suit = null;
    }
    public Card(Values value, Suits suit) {
        Value = value;
        Suit = suit;
    }
    [AntigravProperty("value")]
    public Values? Value { get; private set; }
    [AntigravProperty("suit")]
    public Suits? Suit { get; private set; }
    public override string ToString() => $"{Value} of {Suit}";
}

Card value = new(Values.Ace, Suits.Spades);

// encoding
string antigrav = DumpToString(value);
Console.WriteLine(antigrav); // "{\"value\": 1, \"suit\": 3}"

// decoding
Card decodedValue = LoadFromString<Card>(antigrav);
Console.WriteLine(decodedValue); // "Ace of Spades"

This was made as an experiment at first place, any tweaks in code are welcome

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.13.0 73 11/18/2024
1.12.6 86 10/12/2024
1.12.5 80 10/12/2024
1.12.4 84 10/9/2024
1.12.3 73 10/9/2024
1.12.2 80 10/9/2024
1.12.1 84 10/9/2024
1.12.0 85 10/3/2024
1.11.1 94 9/21/2024
1.11.0 74 9/8/2024
1.10.2 110 8/26/2024
1.10.1 101 8/26/2024
1.10.0 106 8/26/2024
1.9.0 115 8/24/2024
1.8.1 112 8/24/2024
1.8.0 108 8/24/2024
1.7.1 122 8/23/2024
1.7.0 120 8/23/2024
1.6.0 116 8/23/2024
1.5.1 124 8/23/2024
1.5.0 119 8/23/2024
1.4.0 125 8/22/2024
1.3.0 133 8/22/2024
1.2.1 118 8/21/2024
1.2.0 127 8/21/2024
1.1.1 134 8/21/2024
1.1.0 121 8/21/2024
1.0.0 116 8/20/2024