gpt4 book ai didi

Firebase.Database.FirebaseException : Exception occured while processing the request

转载 作者:行者123 更新时间:2023-12-03 23:52:09 26 4
gpt4 key购买 nike

Unhandled Exception: Firebase.Database.FirebaseException: Exception occured while processing the request. Url: https://mylimo-b2029.firebaseio.com/users/.json Request Data: Response: {"first_name":"dsadas"} occurred


Mainpage.xaml.cs :
 protected async override void OnAppearing()
{

base.OnAppearing();
var allUsers = await firebaseHelper.GetAllUsers();
lstPersons.ItemsSource = allUsers;
}
Firebasehelper.cs :
public async Task<List<Users>> GetAllUsers()
{

return (await firebase
.Child("users")

.OnceAsync<Users>()).Select(item => new Users
{
//user_id = item.Object.user_id,
first_name = item.Object.first_name
}).ToList();
}

最佳答案

我遇到了同样的问题,并决定检查是否所有属性都设置了我的本地对象。只是验证属性是否为空,没有解决。

前:

var item = await firebase.Child("users").OnceAsync <Users> ());

然后:

using Newtonsoft.Json.Linq;

var item = await firebase.Child("users").OnceAsync <JObject> ());

问题在于反序列化。您可以通过以下方式访问 JObject 中的属性:

var itemProperty = item.Object.GetValue("<property_name>").

关于Firebase.Database.FirebaseException : Exception occured while processing the request,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56054361/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com