Edit:
looks like this is called a "complex type" in Entity Framework, and I see how I would be able to set the name on columns for having once complex type contained in a class, but I don't know how/if you can do it with multiple of the same complex type contained in the class.
http://blogs.msdn.com/b/wriju/archive/2010/07/26/ef4-complex-type.aspx
EntityFramework 4.1 Code First incorrectly names complex type column names
Since Castle ActiveRecord has been sunset, I am moving over to Entity Framework 5, however I don't know how to accomplish the "nested property" concept that Activerecord had:
http://docs.castleproject.org/Active%20Record.Mappings.ashx#Nested_5
http://docs.castleproject.org/Default.aspx?Page=Nested%20data%20%28NHibernate%20components%29&NS=Active%20Record&AspxAutoDetectCookieSupport=1
I've done my googling, but I'm not sure that "nested" is the proper terminology for this concept in EF, if it even exists. Here are my tables and classes that I had in Castle ActiveRecord, can someone please provide the EF terminology for this and how it can be accomplished:
The Address property on AmaStatementEntity marked with <Nested(ColumnPrefix:="FL")))>
maps to the database columns FLStreet, FLSuite, FLCity, etc.
CREATE TABLE [dbo].[AMA](
--other columns not necessary to discussion removed
[AMAId] [uniqueidentifier] NOT NULL,
[FLStreet] [nvarchar](255) NULL,
[FLSuite] [nvarchar](255) NULL,
[FLCity] [nvarchar](255) NULL,
[FLZipCode] [nvarchar](255) NULL,
[FLCountry] [nvarchar](255) NULL,
[FLState] [nvarchar](255) NULL,
[BAStreet] [nvarchar](255) NULL,
[BASuite] [nvarchar](255) NULL,
[BACity] [nvarchar](255) NULL,
[BAZipCode] [nvarchar](255) NULL,
[BACountry] [nvarchar](255) NULL,
[BAState] [nvarchar](255) NULL,
[PAStreet] [nvarchar](255) NULL,
[PASuite] [nvarchar](255) NULL,
[PACity] [nvarchar](255) NULL,
[PAZipCode] [nvarchar](255) NULL,
[PACountry] [nvarchar](255) NULL,
[PAState] [nvarchar](255) NULL,
[IAStreet] [nvarchar](255) NULL,
[IASuite] [nvarchar](255) NULL,
[IACity] [nvarchar](255) NULL,
[IAZipCode] [nvarchar](255) NULL,
[IACountry] [nvarchar](255) NULL,
[IAState] [nvarchar](255) NULL,
[EAStreet] [nvarchar](255) NULL,
[EASuite] [nvarchar](255) NULL,
[EACity] [nvarchar](255) NULL,
[EAZipCode] [nvarchar](255) NULL,
[EACountry] [nvarchar](255) NULL,
[EAState] [nvarchar](255) NULL,
[PYAStreet] [nvarchar](255) NULL,
[PYASuite] [nvarchar](255) NULL,
[PYACity] [nvarchar](255) NULL,
[PYAZipCode] [nvarchar](255) NULL,
[PYACountry] [nvarchar](255) NULL,
[PYAState] [nvarchar](255) NULL,
CONSTRAINT [PK_AMA] PRIMARY KEY CLUSTERED
(
[AMAId] ASC
))
Public Class AmaStatementEntity
Public Sub New()
_amaId = Guid.NewGuid
End Sub
'Other properties not relavent to discussion removed
<Nested(ColumnPrefix:="FL")))>
Public Property FacilityLocation() As AddressEntity
<Nested(ColumnPrefix:="BA"))>
Public Property BillingAddress() As AddressEntity
<Nested(ColumnPrefix:="PA"))>
Public Property PatientAddress() As AddressEntity
<Nested(ColumnPrefix:="IA"))>
Public Property InsuredAddress() As AddressEntity
<Nested(ColumnPrefix:="EA"))>
Public Property EmployerAddress() As AddressEntity
<Nested(ColumnPrefix:="PYA"))>
Public Property PayorAddress() As AddressEntity
Public Property AMAId() As Guid
End Class
Public Class AddressEntity
Public Property Street() As String
Public Property Suite() As String
Public Property City() As String
Public Property State() As String
Public Property ZipCode() As String
Public Property Country() As String
Public Property AddressId() As Guid
End Class