Helper class used to translate C# dictionaries into Firebase Rest format
Find a file
2021-04-30 15:55:11 +03:00
.circleci Add circle ci support 2020-03-07 17:16:25 +02:00
FirebaseRestTranslator Add support for uint, long types. 2021-04-30 15:55:11 +03:00
FirebaseRestTranslator.UnitTests Add support for uint, long types. 2021-04-30 15:55:11 +03:00
.gitignore Initial commit 2020-03-07 16:13:48 +02:00
FirebaseRestTranslator.sln Initial commit 2020-03-07 16:13:48 +02:00
LICENSE.txt Add licensing information 2020-03-07 16:31:00 +02:00
readme.md Add support for uint, long types. 2021-04-30 15:55:11 +03:00

FirebaseRestTranslator

CircleCI

This is a small helper class that can be used to translate C# dictionaries into the Firebase REST format so they be posted to Firebase directly.

See the tests for usage.

    [Fact]
    public void Test_FirebaseTranslator_BoolValue()
    {
        var data = new Dictionary<string, object>()
        {
            ["myKey"] = false
        };
        var expectedJson = "{\"name\":\"Test_FirebaseTranslator\",\"fields\":{\"myKey\":{\"booleanValue\":false}}}";
        var result = Translator.Translate("Test_FirebaseTranslator", data);
        var actualJson = JsonConvert.SerializeObject(result);
        Assert.Equal(expectedJson, actualJson);
    }

Changelog

0.1.2

  • Added support for uint, long types.