public IHttpActionResult Create([FromBody] Meeting meeting) { try { var meetingid = _store.CreateMeeting(meeting.OrganizorId, meeting.VisitorEmail, meeting.Mobile, System.DateTime.Parse(meeting.DateTime), meeting.Purpose); var meetingCreated = GetMeeting(meetingid); try { var gmail = new GmailServer(); gmail.Send( meetingCreated.VisitorEmail, _mailMessageBuilder.BuildSubject(meetingCreated.OrganizorName), _mailMessageBuilder.BuildBody(meetingCreated) ); } catch (System.Exception) { return(Created("Meeting", meetingCreated)); } return(Ok(meetingCreated)); } catch (System.Exception ex) { } return(BadRequest()); }
public void Create([FromBody] Meeting meeting) { _store.CreateMeeting(meeting.OrganizorId, meeting.VisitorEmail, meeting.Mobile, System.DateTime.Parse(meeting.DateTime), meeting.Purpose); }