我有一个 LightSwitch 应用程序,我需要在其中聚合数据并能够对其进行编辑。我遵循了 Eric Erhardts指南,该指南运行良好。然后在 DomainService 类中,我添加了这个以使更新成为可能:
public void UpdateRuleEntriesById(RuleEntriesById ruleEntryObject)
{
var origRuleEntry = (from RuleEntriesById in this.Context.RuleEntries
where RuleEntriesById.Id == ruleEntryObject.Id
select RuleEntriesById).FirstOrDefault();
origRuleEntry.Country = ruleEntryObject.Country;
this.Context.SaveChanges();
}
这也很好,我可以在 RuleEntry 表中编辑和保存 Country 属性。但是 Country 是它自己的实体,我希望它显示为 AutocompleteBox,就像我在不使用 RIA 服务的情况下导入数据库一样。我想我需要告诉 Country 是 Country 表或其他东西的外来属性,但是我在哪里以及如何做到这一点?
谢谢