Answer the question
In order to leave comments, you need to log in
How to use data annotations in c# web api?
Good afternoon! in MVC, you can control the visibility of fields using attributes from the System.ComponentModel.DataAnnotations space. How can you do the same with asp .net web api?
Answer the question
In order to leave comments, you need to log in
Alternatively, you can mark the class as [DataContract], set the DataMember to the required fields, and do not mark the fields that should be invisible (well, or for clarity, mark IgnoreDataMember)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question