public Rating UpdateRate(long id, EditRatingRequest request, ClaimsPrincipal currentLoggedUser) { var loggedUserID = currentLoggedUser.GetUserID(); var isAdmin = new[] { Roles.ContentManager.ToString(), Roles.Administrator.ToString() }.Contains(currentLoggedUser.GetUserRole()); var entity = MoviesRepository.EditRate(id, request.Text, request.NewMovieID, request.Score, request.Anonymous, loggedUserID, isAdmin); return(Mapper.Map <Rating>(entity)); }