public async Task<IHttpActionResult> GetFeedbacksRate(string userId)
        {
            IList<Feedback> feedbacks = await db.Feedbacks.Where(p => p.UserId == userId).ToListAsync();
            if (feedbacks == null)
            {
                return NotFound();
            }

            int feedbackCounter = feedbacks.Sum(p => p.Rate);
            double feedbackRate = 100 * (double)(feedbackCounter / feedbacks.Count);
            if(feedbackRate < 0) { feedbackRate = 0; }

            FeedbackRate fr = new FeedbackRate()
            {
                Rate = feedbackRate,
                Counter = feedbackCounter
            };

            return Ok(fr);
        }
        public async Task<IHttpActionResult> GetUserProfile(string id)
        {
            User user = await Task.Run(() => db.Users.FirstOrDefault(u => u.Id == id));
            if (user == null)
            {
                return NotFound();
            }

            int libraryId = db.Libraries.Where(x => x.UserId == user.Id).FirstOrDefault().LibraryId;
            int gameInLibrary = db.LibraryComponents
                                  .Where(p => p.LibraryId == libraryId)
                                  .Where(p => p.IsDeleted == false)
                                  .Count();

            IList<Feedback> feedbacks = await db.Feedbacks.Where(p => p.UserId == id).ToListAsync();
            if (feedbacks == null)
            {
                return NotFound();
            }

            int feedbackCounter = feedbacks.Sum(p => p.Rate);
            double feedbackRate = default(double);

            if (feedbacks.Count == 0)
                feedbackRate = 0;
            else
                feedbackRate = 100 * (double)(feedbackCounter / feedbacks.Count);

            if (feedbackRate < 0) { feedbackRate = 0; }

            FeedbackRate fr = new FeedbackRate()
            {
                Rate = feedbackRate,
                Counter = feedbackCounter
            };

            UserResponse response = new UserResponse()
            {
                Id = user.Id,
                UserId = user.UserId,
                Username = user.UserName,
                Mail = user.Email,
                PositionUser = user.PositionUser,
                Image = user.Image,
                LastLogin = user.LastLogin,
                GameInLibrary = gameInLibrary,
                LibrariesId = new List<int>(libraryId),
                FeedbackAvg = (float)fr.Rate,
                FeedbackCount = fr.Counter
            };

            return Ok(response);
        }