public async Task <IActionResult> Store([FromBody] CallTimelineViewModel callTimeline) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { Guid UserId = Guid.Parse(this.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier).Value); callTimeline.UserId = UserId; await this._callTimelineService.InsertAsync(callTimeline); } catch (System.Exception ex) { return(StatusCode(500, ex)); } return(Ok()); }
public async Task InsertAsync(CallTimelineViewModel callTimeLine) { await this._callTimelineRepository.InsertAsync(this._mapper.Map <CallTimeline>(callTimeLine)); }