When and how to use [ResponseType(typeof(...))] correctly?
<p>I am working on a project and I have a basic controller with <code>Get(int id)</code>, <code>GetElements()</code>, <code>UpdateElement(int id, Element element)</code>, <code>AddElement(Element element)</code> and <code>DeleteElement(int id)</code>.
Every method use <code>[Route]</code> and <code>[Get]</code>... annotations and returns an <code>IHttpActionResult</code>.</p>
<p>I am confused about <code>[ResponseType(typeof(...))]</code>. What is it for? When and how to use it correctly?</p>
<p>Should I write something like this?
<code>[ResponseType(typeof(IEnumerable&lt;Element&gt;))]</code> for <code>GetElements()</code>?</p>
<p>Thanks!</p>