English 中文(简体)
哪一种情况与POCO模式财产一样好:外国Key/ID或目标参照?
原标题:Which one is better as POCO model property: ForeignKey/ID or Object reference?

我开始在我正在进行的项目中使用EF4.1和POCO。 我使用的模式就是这样:

 public class Contact1
    {
        // Primary key
        public int ID { get; set; }

        public string FirstName { get; set; }
        public string LastName { get; set; }
        public virtual Address DelAddress { get; set; }
        public virtual Address POAddress { get; set; }
        public string EmailAddress { get; set; }
        public bool InActive { get; set; }
        public string Comment { get; set; }
        public string Phone1 { get; set; }
        public string Phone2 { get; set; }
    }

但是,我确实看到了一些例子,利用外国信息数据库作为地址等外地的参考,我正在我的模型中直接提及地址目标。 我认为,最好参考一下子,因为我是在这一层次上处理物体,但不是记录或行文,最后用一个电文提及。 但是,你们对《刑法典第一范本》有什么用处?

问题回答

假设其他所有东西都是一样的,标语的参考资料较好,因为基于“软”的参考资料的“噪音”污染了你的模型。

尽管如此,在上,所有其他物品都是与Ladislav写的。 外国钥匙 Independent Associations in EF 4. 例如,独立协会要求你保持关系的两个目的。 在保留最新情况时,这可能是一个问题,因为如果你不这样做,就必须装上关系的目标,以便列入<代码>。 ObjectStateManager。 在拯救一个多处提到“参考数据”类型的实体以及在N级结构中工作的实体时,这是一种特别的痛苦。

工作主要是,但执行工作没有完成,没有平等。 因此,如果对你的使用模式、结构和业绩要求进行更严格的分析,则不能完全肯定地回答better>。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签