public virtual async Task <IHttpActionResult> Put([FromBody] TResourceWriteModel v2Request, [FromUri] Guid id) { short schoolYearFromRoute = Convert.ToInt16(RequestContext.RouteData.Values["schoolYearFromRoute"]); var v3Type = _v3TypeForV2Type.Value; var v3Request = WebApiApplication.Mapper.Map( (object)v2Request, typeof(TResourceWriteModel), v3Type, opts => { opts.Items.Add("Invoker", UpstreamEdFiApiInvoker); opts.Items.Add("Headers", Request.Headers); opts.Items.Add("SchoolYear", schoolYearFromRoute); }); var response = await UpstreamEdFiApiInvoker.Put <TResourceWriteModel>(id, Request.Headers, v3Request, schoolYearFromRoute); var httpResponseMessage = CreateResponseMessage(response); return(new ResponseMessageResult(httpResponseMessage)); }