just visit the link http://www.c-sharpcorner.com/UploadFile/4b0136/Asp-Net-web-api-using-entity-framework-6-day-1/
i saw they use task for every action and they use [ResponseType(typeof(CollegeDetail))] why ?
// POST: api/CollegeDetails [ResponseType(typeof(CollegeDetail))] public async Task<IHttpActionResult> PostCollegeDetail(CollegeDetail collegeDetail) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.CollegeDetails.Add(collegeDetail); await db.SaveChangesAsync(); return CreatedAtRoute("DefaultApi", new { id = collegeDetail.CollegeID }, collegeDetail); }
what is the meaning of [ResponseType(typeof(CollegeDetail))] attribute usage ?
when one should use [ResponseType(typeof(CollegeDetail))] attribute ?
ResponseType attribute is only used when action type is async ?
please guide me. thanks