public async Task <IActionResult> AddReportAsync([FromBody] SpeakerRequestModel speakerRequest) { var res = await _speakersService.CreateSpeakerAsync(speakerRequest); var responseStatus = new StatusResponseModel { Status = true, Message = "Speaker added successfully", ID = res }; return(Ok(responseStatus)); }
public async Task <Guid> CreateSpeakerAsync(SpeakerRequestModel speakerRequestModel) { var speaker = new Speaker() { Name = speakerRequestModel.Name, Bio = speakerRequestModel.Bio, SessionId = speakerRequestModel.SessionId, WebSite = speakerRequestModel.WebSite }; _context.Speakers.Add(speaker); await _context.SaveChangesAsync(); return(speaker.Id); }