What's the difference between property Entity Reference and property in Entity Data Model?
I have three tables structure like following
AppUser User App
********* ****** ******
AppUserId UserId AppId
UserId
AppId
UserId and AppId of Table AppUser is foreign keys to table User and App. When I generate 3 tables to Entity Data Model, it has three cl开发者_高级运维ass AppUser, User as well as App. However, I don't uderstand AppUser.UserReference and AppUser.User
AppUser.User is navigational property of type User, AppUser.UserReference is of type
EntityReference<User>
. They are comletely different objects.
You can use AppUser.User to access related user properties or to change related user.
You can use AppUser.UserReference, for example, to load related user with EntityReference<T>.Load()
method.
In fact AppUser.UserReference.Value equals AppUser.User.
精彩评论