Hi Shane,
When you call both methods back-to-back, it is going to the database twice. Even if you use a Context object to cache, you're still going to the database.
It really depends what you want to do.
If you want both screens viewing/editing the same User object at the same time (meaning, changing User.Name on one screen automatically changes the other screen) - then yes, you can pass the actual Entity to both screens instead of the ID.
However, if you want the screens viewing/editing the same User object, but do not want changes to be reflected in the other screen - then you need to Clone the User object, and pass the cloned User object to the second screen. This way they'll be editing different instances of the same User object. And you only went to the DB once.
So, to simplify, I think you have 3 options:
- Pass by ID (Loads Entity from DB several times)
- Pass by Entity, Shared Entity across 2 screens (Goes to DB once)
- Pass by Cloned Entity, Entities are independent of eachother. (Goes to DB once)
Hope this helps!
Ryan