Esempio n. 1
0
        public async Task <IActionResult> Edit(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            Guid deviceId = await GetDeviceIdAsync(id.Value);

            ViewData[GarduinoConstants.DeviceId] = deviceId;
            return(View(await _repository.GetAsync(id.Value)));
        }
Esempio n. 2
0
        public async Task <IActionResult> GetCode([FromRoute] Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Code code = await _repository.GetAsync(id);

            if (code == null)
            {
                return(NotFound());
            }

            return(Ok(code));
        }