public ActionResult PostLocationReport(Guid memberId, [FromBody] LocationReport locationReport) { MemberLocationRecordedEvent locationRecordedEvent = converter.CommandToEvent(locationReport); locationRecordedEvent.TeamID = teamServiceClient.GetTeamForMember(locationReport.MemberID); eventEmitter.EmitLocationRecordedEvent(locationRecordedEvent); return(this.Created($"/api/members/{memberId}/locationreports/{locationReport.ReportID}", locationReport)); }
public async Task <IActionResult> Post(Guid memberId, [FromBody] LocationReport locationReport) { var locationRecordedEvent = _commandEventConverter.CommandToEvent(locationReport); locationRecordedEvent.TeamId = await _teamServiceClient.GetTeamForMemberAsync(locationReport.MemberId); _eventEmitter.EmitLocationRecordedEvent(locationRecordedEvent); return(this.Created($"/api/members/{memberId}/locationreposts/{locationReport.Id}", locationReport)); }