title: Per resource Json Formatting asp.net core
body: <p>I am building a REST api using ASP.Net core 1.0.0, and I am currently trying to figure out a way to serialize and deserialize Incoming request body and out going responses.</p>
  
  <p>for example, I have the following </p>
  
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; Post([FromBody]ScheduleEvent scheduleEvent)
  {
       . 
       .
       .
       return Ok(scheduleEvent);
  }
  </code></pre>
  
  <p>The thing is, ScheduleEvent is a database model, so not all the properties should be sent or received from/to the client.</p>
  
  <p>The only solutions I could find are either creating DTO classes and converting the DTO objects to and from model objects, or placing jsonattributes over the object. The first seems like an unnecessary workaround, and the second forces you to make your models depend on json.net, besides the fact that it also makes serialization and deserialization exactly the same. Basicly they all seem like bad solutions - mostly since json.net allows using schemas to invalidate incoming/outgoing json, and If someone were to use it he could create such functionality easily by creating input and output schemas per type or per Controller/Action.</p>
  
  <p>However, JsonConverter doesn't seem like the right way to go, and creating my own json output and input formatters seems like a lot of work, for something that might have a better solution.</p>
  
  <p>So basically, the question is, what is the common way of addressing this problem, and do you know any better solution?</p>