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

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