Developer Network
Developer Network
Developer
:CreateViewProfileText:
Sign in
Subscriber portal
Get tools
Downloads
Visual Studio
SDKs
Trial software
Free downloads
Office resources
Programs
Subscriptions
Overview
Administrators
Students
Microsoft Imagine
Microsoft Student Partners
ISV
Startups
Events
Community
Magazine
Forums
Blogs
Channel 9
Documentation
APIs and reference
Dev centers
Samples
Retired content
We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second.
Ask a question
Quick access
Forums home
Browse forums users
FAQ
Search related threads
Remove From My Forums
Answered by:
0..1:* relationship
Archived Forums
>
ADO.NET Entity Framework and LINQ to Entities (Pre-Release)
Question
0
Sign in to vote
Relationship(c => c.Department).IsRequired()
.FromProperty(d => d.Courses).HasConstraint(
(c, d) => c.DepartmentID == d.DepartmentID);
Relationship(c => c.Department)
.FromProperty(d => d.Courses).HasConstraint(
(c, d) => c.DepartmentID == d.DepartmentID);
Relationship(c => c.Department)
.HasConstraint(
(c, d) => c.DepartmentID == d.DepartmentID);
All have the same result : 1...* relationship
I want to have 0...* relationship,and read DepartmentID directly ,how can i set
DepartmentID =0 (NULL)
ParentId=0 (NULL)
Moved by
Michael Sun [MSFT]
Microsoft employee
Tuesday, March 23, 2010 9:36 AM
Code Only in EF4 (From:ADO.NET Entity Framework and LINQ to Entities)
Wednesday, March 17, 2010 2:34 AM
Answers
0
Sign in to vote
Is DepartmentID nullable? If it is not, then the relationship must be 1:*, not 0..1:*.
This posting is provided "AS IS" with no warranties, and confers no rights.
Marked as answer by
Noam Ben-Ami - MSFT1
Moderator
Thursday, April 8, 2010 10:15 PM
Thursday, April 8, 2010 10:15 PM
Moderator