KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am looking for a way in my view models to shorten property names in the querystring for a search form. For example, the verbose property name could be query but you see q in the querystring. Currently, I am doing the following to achieve this. public string Query { get; set; } public string q { get { return Query; } set { Query = value; } } I would think it might be easier if there was a data annotation to help with this. [Querystring(Name="q")] public string Query { get; set; } Is there a better way to do this that I am not thinking of or is it possible to code my own data annotation like that?
Tags (comma-separated)
Save Edits
Cancel