【发布时间】:2023-04-10 22:19:01
【问题描述】:
我目前正在使用以下方法将数据插入表中。
public async void PerformRegistration()
{
var personTable = App.MobileService.GetTable<PersonTable>();
var person = new PersonTable
{
FirstName = FirstNameTextBox.Text,
LastName = LastNameTextBox.Text,
EmailAddress = EmailTextBox.Text,
Password = PasswordTextBox.Password,
DateOfRegister = DateTime.Now
};
await personTable.InsertAsync(person);
}
我可以像下面看到的那样访问它
var person = await personTable
.Where(p => p.EmailAddress == EmailTextBox.Text)
.ToListAsync();
对数据库中已有的条目执行更新的最简单方法是什么?我不确定如何使 Id 保持相同的值。
【问题讨论】:
标签: c# .net azure windows-runtime windows-store-apps