hello, I use Entity Data Model but I have aproblem: If a table e.g Customers have categoryId(foreign key from table category) it is not appear in cutomers entity???? so how can i retrive this value or set it?
The Entity Framework does render the actual property itself, it will create an property of Type Category. i.e.:
Customer.Category = new Category()
The Entity Framework will handle the references / foreign keys internally.
Colin's answer is 100% accurate and true - for the currently available release of the Entity Framework (with .NET 3.5 SP1).
For the upcoming and not-yet-released EF v2 (or EF 4??) that will ship with .NET 4.0 sometime in the future, the EF team has added what they call "foreign key associations", which in essence will allow you to just specify the foreign key value (e.g. CategoryID) instead of having to create / load / assign the whole associated entity.
See more in these excellent posts:
DISCLAIMER: this is pre-release information about a not-yet-released product and with no delivery date officially announced - you can download a Beta1 for now.
Marc