Flyboy

Age: 38

Feb
28
awarded Popular Question
Jun
29
accepted Need help Linq Query Group By + Count
Jun
29
comment Need help Linq Query Group By + Count
It works.. Thank you so much for your quickly answer...
Jun
29
awarded Student
Jun
29
asked Need help Linq Query Group By + Count
Mar
13
awarded Scholar
Mar
13
accepted Multiple Foreign keys in single Table Entity Framework 4.3.1
Mar
13
comment Multiple Foreign keys in single Table Entity Framework 4.3.1
I must give up... After i have implemented this to my WCF Service and try to send some real Data to the Service i run in problems with my "Treeview like" logic! I can't import in this way. Liegenschaft-->Haus-->Objekt are OK but Mieter and Mietzins must be filled under Liegenschaft. Mieter is no problem only FK to Liegenschaft is needed. After SaveChanges the FK for Mietzins must be set with Helper Query's. (ok it's not optimal) "My problem are i have duplicate Data on Destination DB!" Thank you for the good Help and Code. I can use the most of this! And the best => i learned many!
Mar
13
comment Multiple Foreign keys in single Table Entity Framework 4.3.1
Wow your Help is great..! Thank you so much! I have changed to CodeFirst and test your Sample... it works perfect! Now i have added a second "Objekt" to List<Objekt> to test with more realistic data... this give me an error: Unable to determine the principal end of the Objekt_MietzinsMenge relationship. Multiple added entities may have the same primary key. And by adding more Haus to List<Haus> is the same error. Add more Mieter to List<Mieter> is no problem. In realistic scenario Liegenschaft can have 1 or more Haus and Haus can have 1 or more Objekt.
Mar
12
comment Multiple Foreign keys in single Table Entity Framework 4.3.1
Hmm.. I am a Noob and can't understand the way you mean. How can i add/overwrite the relation? In a foreach set "new EntityKey" ? in this way i must know the ID of Parent or not? what you mean with "break the big expression" and how to "set the Objekt navigation property of each Mietzens to point to the Objekt instance"? Sorry my "simple" Questions have you a Sample for me or a Link for similar solution. Thank you so much for your Time.
Mar
9
comment Multiple Foreign keys in single Table Entity Framework 4.3.1
Thank you GertArnold for your Answer... German Table Names are not good for understand the logic... Mietzins has same role of "Booking entry" witch Mieter has witch Objekt booked (startDate, EndDate) Liegenschaft FK is not really required. it has only be added to insert my Data in logic Tree Format.
Mar
9
comment Multiple Foreign keys in single Table Entity Framework 4.3.1
Thank you for your help ajcvickers, Table Mietzins has an Identity Column (Id) and is set to autoincrement int. This Model is Database First created. All of the other Tables has no problem with the FK insert. On Image (Link) i have posted you can see the Relationship Objekt(1)to(many)Mietzins who makes my trouble... I can fill many Haus to List, many Objekt to List, many Mieter to List.. all rows added to db with correct FK to the parent Table. Only the Mietzins can not be used to fill data...
Mar
9
asked Multiple Foreign keys in single Table Entity Framework 4.3.1