Ivan
Ivan

Reputation: 1284

reference valueobject collection from entity

How can I map the value of an object collection using fluent mapping?

I am trying:

HasMany<DateTimeRentPriceDetailsMap>(x => x.RentPriceDetails); 

where DateTimeRentPriceDetail is an IList<DateTimeRentPriceDetail>

DateTimeRentPriceDetails is a value object with 2 fields.

I am getting an error, which says that I am referencing an unmapped class, but the class is mapped.

Upvotes: 0

Views: 88

Answers (1)

Justin
Justin

Reputation: 2103

You should be mapping to the entity not the entity's map. Depending on which table the foreign key is stored you may need to specify the column name but the below mapping references a collection of entities.

HasMany<DateTimeRentPriceDetails>(x => x.DateTimeRentPriceDetail)

Upvotes: 1

Related Questions