C#DbSet - 内部对象的关联不能得到 [英] c# DbSet - Internal object association cannot be got

查看:153
本文介绍了C#DbSet - 内部对象的关联不能得到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有同样的问题 这个话题。但实体之间的关联。

I have the same problem of this topic. but on the association between entities.

internal virtual ICollection<Adress> Adresses { get; set; }

它的工作原理,如果我用的是这样的:

It works if I use like this:

public virtual ICollection<Adress> Adresses { get; set; } 

我怎么能初始化不会忽略?

How can I initialize Adresses ?

推荐答案

实体框架将只与工作公开属性。如果要使用不同的接入修改你应该看看NHibernate的。

Entity Framework will only work with public properties. If you want to use different access modifies you should check out nHibernate.

这篇关于C#DbSet - 内部对象的关联不能得到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆