实体之间有以下关系。
客户 - >地址(通过导航属性)
我将客户绑定到网格,但如何使用导航属性显示地址信息?我一直在搜索,无法弄明白。 :(
这是我目前的代码。我还尝试将Grid中的DataProperty设置为" Address.Street",没有运气。
GroomerEntities context = new GroomerEntities();
context.ContextOptions.LazyLoadingEnabled = true;
gvCustomers.DataSource = context.Customers;