I have a user entity with the following properties that map to a field in the database:
Id int
Username varchar(25)
Password binary(64)
Salt binary(64)
Name varchar(50)
Locked bit
What I don't want to do is always return the Password and Salt for every query. But for certain queries, I do want to be able to check the password (from u in db.Users where u.Password == password select u
) or set the Password/Salt fields. I don't want 128B always going over the wire when it's never needed.
I tried setting the property's getter to private, but that stopped me from using it in LINQ. Basically it would be cool if I could set a property to always lazy load.