【发布时间】:2013-04-26 12:37:45
【问题描述】:
我有一个 LightSwitch 应用程序,我需要在其中聚合数据并能够对其进行编辑。我跟着 Eric Erhardts guide 工作正常。然后在 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 表或其他东西的外来属性,但我在哪里以及如何做到这一点?
谢谢
【问题讨论】:
标签: foreign-keys wcf-ria-services visual-studio-lightswitch