I have a Model Class (entity framework) User
, and when doing a Request.CreateResponse
, I don't want its' password property to be serialized and sent.
I read in a SO post that there's a [JsonIgnore]
for such cases, to be used in the property, but for some reason my Visual Studio doesn't know how to resolve it (I'm guessing it isn't from the web api library itself...? I'm pretty new to C#, but VS can't seem to suggest it using Ctrl+. )
So anyway, what is the best advice here? If possible I don't want to make a DTO just for that.