Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 06, 2013 09:49 AM by thaicarrot
Participant
902 Points
303 Posts
Jan 05, 2013 06:52 PM|LINK
If I have a class "Sag" that has a public property which contains a List of objects 'Ratings"(which are optional)
and in the extended EntityConfiguationType class I have the following configuration:
HasOptional(s => s.Ratings); HasMany(s => s.Ratings).WithRequired(r => r.Sag);
if I add a new "Rating" to the "Sag" property List
and then save changes via the DbContext
will the new "Rating" be stored in the Rating table
or do I need to use the Rating DbSet to explicitly store the new rating?
Thanks in advance!
All-Star
118619 Points
18779 Posts
Jan 06, 2013 07:14 AM|LINK
Hello,
Can you show us your full EF (Code-first)codes and explain in details about what you want?
Contributor
5433 Points
1508 Posts
Jan 06, 2013 09:49 AM|LINK
A: Yes.
remojr76
Participant
902 Points
303 Posts
EF CodeFirst Multiplicity
Jan 05, 2013 06:52 PM|LINK
If I have a class "Sag" that has a public property which contains a List of objects 'Ratings"(which are optional)
and in the extended EntityConfiguationType class I have the following configuration:
if I add a new "Rating" to the "Sag" property List
and then save changes via the DbContext
will the new "Rating" be stored in the Rating table
or do I need to use the Rating DbSet to explicitly store the new rating?
Thanks in advance!
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: EF CodeFirst Multiplicity
Jan 06, 2013 07:14 AM|LINK
Hello,
Can you show us your full EF (Code-first)codes and explain in details about what you want?
thaicarrot
Contributor
5433 Points
1508 Posts
Re: EF CodeFirst Multiplicity
Jan 06, 2013 09:49 AM|LINK
if I add a new "Rating" to the "Sag" property List
and then save changes via the DbContext
will the new "Rating" be stored in the Rating table
A: Yes.
Weera