I'm not sure if it's better to create separate models for input and output from my Web API controllers or operating on entities(speaking in EF context) directly.
I can control which properties to serialize using [JsonIgnore] or setting MemberSerialization.OptIn to ignore properties by default and only include what's necessary.
I currently put data annotations for validation in my entity models, like [Regex] for example (I'm not sure if that's used by Entity Framework core)
What should I do?
for example I have class Person, that would mean I would have had to create other classes like PersonCreateParams, PersonCreateResponse etc.