Esempio n. 1
0
        public IList Drawings(int page = 0, int pageSize = 10)
        {
            if (!Request.Headers.Keys.Contains("x-drawwars-auth"))
            {
                throw new Exception("Not authenticated");
            }

            var header = Request.Headers["x-drawwars-auth"];
            var userId = CryptoUtils.GetUserIdFromHeader(header);

            return(_drawingRepository
                   .ListByUser(userId)
                   .Select(d => new
            {
                d.GameRoomId,
                d.PlayerId,
                d.ThemeId,
                _themeRepository.Get(d.ThemeId).Text,
                d.Url
            })
                   .ToList());
        }