c# - Selectively Serialize and Deserialize -


i have user object in linq-to-sql mapping. there password attribute on want deserialize when submitted user--for example, during login. never want pass attribute user, though, since contain encrypted version of actual password , i'd rather not expose information password or encryption method. there way object-wide tell linq-to-sql never pass password attribute when returning user object?

i use https encryption, because in accessing service, default enforce encryption, saves on client side code. have few possible answers though:

  1. blank out password when return user object wcf side. (you can change value of password of object, , not save change.. return object client )
  2. use custom object login response returns necessary information client.
  3. implement data transfer object pattern, nuget package automapper.

if aren't salting , hashing passwords, please please please consider it.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -