Example #1
0
        private async Task <DriverWriteResource> AttachUserIdToRecord(DriverWriteResource record)
        {
            var user = await Identity.GetConnectedUserId(httpContext);

            record.UserId = user.UserId;
            return(record);
        }
Example #2
0
 public async Task <IActionResult> PutDriverAsync([FromBody] DriverWriteResource record)
 {
     repo.Update(mapper.Map <DriverWriteResource, Driver>(await AttachUserIdToRecord(record)));
     return(StatusCode(200, new {
         response = ApiMessages.RecordUpdated()
     }));
 }