public async Task <HttpResponseMessage> SkillThumbsUp([FromBody] ThumbsForSkillRequest request) { if (!(request.ProfileUser.IsMatch(x => request.ProfileUser, RegexPattern.UserName, ActionContext, ModelState) && Validation.StringLength(request.ProfileUser, x => request.ProfileUser, 6, 30, ActionContext, ModelState)) && !request.ProfileUser.IsMatch(x => request.ProfileUser, RegexPattern.Numeric, ActionContext, ModelState)) { return(ActionContext.Response); } var response = await _profilePersonalService.UpsertThumbsForSkill(request, Request.GetSession()).ConfigureAwait(false); return(Request.SystemResponse(response)); }
public Task <StatusData <ThumbsForSkillResponse> > UpsertThumbsForSkill(ThumbsForSkillRequest request, SystemSession session) { return(_jUnitOfWork.ProfilePersonal.UpsertThumbsForSkill(request, session)); }
public async Task <StatusData <ThumbsForSkillResponse> > UpsertThumbsForSkill(ThumbsForSkillRequest request, SystemSession session) { var serviceRequest = new Kauwa.Skill { UserId = session.UserId, Username = session.UserName, SkillTypeId = request.SkillTypeId, ThumbsUpOrDown = request.ThumbsUporDown, ProfileUser = request.ProfileUser, UserIdOrName = session.UserName }; var response = await Task.Factory.StartNew(() => Client.UserService.upsertThumbsForSkill(serviceRequest, session.GetSession())).ConfigureAwait(false); var result = new StatusData <ThumbsForSkillResponse> { Status = (SystemDbStatus)response.DbStatus.DbStatusCode, Message = response.DbStatus.DbStatusMsg, SubStatus = response.DbStatus.DbSubStatusCode }; if (result.Status.IsOperationSuccessful()) { result.Data = new ThumbsForSkillResponse { ThumbsUp = response.ThumbsUp, ThumbsDown = response.ThumbsDown, YourThumb = response.YourThumb }; } return(result); }