【发布时间】:2018-10-28 14:33:59
【问题描述】:
我在 Xamarin 项目中使用 Realm 数据库
我有这个模型的领域对象
public class UserModel: RealmObject
{
public string Id { get; set;}
public string Email { get; set; }
public string Password { get; set; }
public byte[] UserAvatar { get; set; }
public string ApiKey { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string Birthday { get; set; }
public int Country_id { get; set; }
public bool IsAuthorized { get; set; }
public string Base64Avatar { get; set; }
public string Telephone { get; set; }
}
我需要更新Name 属性。
我如何尝试这样做
var realm = Realm.GetInstance();
var user_check = realm.All<UserModel>().First();
user_check.Name = "Test"
得到这个错误
我该如何解决这个问题?
【问题讨论】:
标签: c# .net xamarin xamarin.ios realm