public async Task <IHttpActionResult> CommentVacancy(VacancyCommentCreateModel model) { try { userId = User.Identity.GetUserId(); Helpers.Helpers.AddBaseProperties(model.comment, "create", userId); Helpers.Helpers.AddBaseProperties(model.vacancyComment, "create", userId); Helpers.Helpers.AddBaseProperties(model.commentUser, "create", userId); model.commentUser.userId = userId; return(Ok(await VacanciesService.CommentVacancy(model))); } catch (Exception) { throw; } }
public async Task <CommentModel> CommentVacancy(VacancyCommentCreateModel data) { try { tblComment resComment = await Task.Run(() => ManageComments.InsertComment(data.comment.ConvertTotblComment())); data.vacancyComment.commentId = resComment.ID; tblVacancyComment res = await Task.Run(() => ManageVacancyComments.CommentVacancy(data.vacancyComment.ConvertTotblVacancyComment())); data.vacancyComment.Id = res.ID; data.commentUser.commentId = resComment.ID; tblCommentUser resCommentUser = await Task.Run(() => ManageComments.InsertCommentUser(data.commentUser.ConvertTotblCommentUser())); return(resComment.ConvertToComment()); } catch (Exception ex) { throw; } }