Exemplo n.º 1
0
        private async Task UpdateP()
        {
            FirestoreDb db          = FirestoreDb.Create(ProjectID);
            var         policlinics = db.Collection("policlinics");
            var         query       = await policlinics.GetSnapshotAsync();

            var p = query.Select(x => x.ConvertTo <Policlinic>())
                    .Where(x => x.Address == null).ToList().First();
            var p2 = await Clinics.GetPoliclinic(p);

            var q2 = await policlinics.WhereEqualTo("Name", p2.Name).GetSnapshotAsync();

            await q2.First().Reference.SetAsync(new
            {
                City    = p2.City,
                Address = p2.Address
            }, SetOptions.MergeAll);

            MessageBox.Show(p.Name + "\r\n" + p2.City + "\r\n" + p2.Address);
        }