Ejemplo n.º 1
0
        public async Task <object> GetData(string Event, string Team, string Match, string Data)
        {
            string     Path  = "events/" + Event + "/teams/" + Team + "/matches/" + Match + "/" + Data;
            ChildQuery Query = Client.Child(Path);

            return(await Query.OnceSingleAsync <object>());
        }
Ejemplo n.º 2
0
        static async Task Firebase()
        {
            FirebaseClient client = new FirebaseClient("https://xxxxxxxxxxxxxxx.firebaseio.com");

            ChildQuery child = client.Child("xxxxxx");

            Shopee data = await child.OnceSingleAsync <Shopee>();

            Console.WriteLine(JsonConvert.SerializeObject(data));
        }
Ejemplo n.º 3
0
        public static async Task Connect(string restaurantConnectionString)
        {
            string[] restaurantConnectionStringArray = restaurantConnectionString.Split(' ');
            string   restaurantKey = restaurantConnectionStringArray[0];
            int      tableId       = Int32.Parse(restaurantConnectionStringArray[1]) - 1;

            firebaseClient = new FirebaseClient(Constants.FirebaseUrl);

            connectionString = restaurantConnectionString;

            ChildQuery childQuery = firebaseClient.Child("Restaurants").Child(restaurantKey);

            restaurant = await childQuery.OnceSingleAsync <Restaurant>();

            childQuery = firebaseClient.Child("Restaurants").Child(restaurantKey).Child("Tables").Child(tableId.ToString());

            Table table = restaurant.Tables.FirstOrDefault(x => x.Number == (tableId + 1));

            table.OccupiedStatus = true;

            await childQuery.PutAsync(table);

            ConnectionStatus = true;
        }