Xamarin窗体Firebase DeleteAsync逻辑-为什么删除第一项而不是第二项



在我的代码中要做的是,当我删除第二个块而不删除第一个块时,被删除的是第一个块,而不是选定的第二个">

//This is where the listview item tapped
var certification = args.Item as Certifications;
if (certification == null) return;
await Navigation.PushAsync(new CertificationDetailsPage(certification));
lstCertifications.SelectedItem = null;
// This is the code to delete
var toDeleteCertification = (await client
.Child("Table => Certifications")
.OnceAsync<Certifications>()).FirstOrDefault(a => a.Object.FullName == fullName || a.Object.Email == email || a.Object.Address == address
|| a.Object.Occupation == occupation || a.Object.Age == age || a.Object.Sex == sex || a.Object.CivilStatus == civilStatus
|| a.Object.Date == date || a.Object.TypeofCertificate == typeofCertificate || a.Object.Purpose == purpose);
await client.Child("Table => Certifications").Child(toDeleteCertification.Key).DeleteAsync();

把这个答案放在这里,以确认Beginnerton解决了他们的问题。

这是删除表达式中的一个逻辑错误;需要CCD_ 1而不是CCD_。

最新更新