c# - Web API hide field from consumer of service -
i have class - person
. consumer of web api service must set id. don't want them able set or see internalid.
public class person { [required(errormessage = "id required.")] public string id { get; set; } public string internalid { get; set; } }
other parts of application need work internalid, setting private/internal won't work.
why don't obfuscate id? have function crypting id value , de-crypting it. encrypted id public , decrypted id private.
Comments
Post a Comment