Esempio n. 1
0
        public IActionResult GetQueries(IQueryCollection queries)
        {
            object specsInfo = null;

            switch (queries.First().Key.ToLower())
            {
            case "ram":
            {
                if (!int.TryParse(queries["deviceId"], out int id))
                {
                    return(NotFound());
                }
                if (id <= 0)
                {
                    return(NotFound());
                }
                if (!_service.GetByDeviceId(id, out specsInfo))
                {
                    return(NotFound());
                }
            }
            break;

            default:
                return(NotFound());
            }
            return(Ok(specsInfo));
        }