public bool loadRawDataTable() { FirebaseResponse getResponse = firebaseDB.Get(); Console.WriteLine(getResponse.Success); if (getResponse.Success) { var dictionary = JsonConvert.DeserializeObject <Dictionary <string, Contacts> >(getResponse.JSONContent); cTable = new DataTable(); cTable = DictionaryToDataTable.ConvertTo <Contacts>(dictionary, "DemoTable"); } tblFiltered = cTable.AsEnumerable() .Where(r => r.Field <string>("Category") == "Admin") .CopyToDataTable(); string name = tbFirstName.Text.Trim(); string email = tbEmail.Text.Trim(); bool contains = tblFiltered.AsEnumerable().Any(row => name == row.Field <String>("Name")) && tblFiltered.AsEnumerable().Any(row => email == row.Field <String>("Email")); return(contains); // var result = tblFiltered.Rows.Find(tbEmail.Text); }
public DataTable loadRawDataTable() { FirebaseResponse getResponse = firebaseDB.Get(); Console.WriteLine(getResponse.Success); if (getResponse.Success) { var dictionary = JsonConvert.DeserializeObject <Dictionary <string, Contacts> >(getResponse.JSONContent); cTable = new DataTable(); cTable = DictionaryToDataTable.ConvertTo <Contacts>(dictionary, "DemoTable"); } tblFiltered = cTable.AsEnumerable() .Where(r => r.Field <string>("Category") != "Admin") .CopyToDataTable(); dgvContactView.DataSource = tblFiltered; return(tblFiltered); }