예제 #1
0
        public async Task <IActionResult> Edit(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return(BadRequest());
            }

            var entry = await _devices.GetFirstOrDefaultAsync(a => a.Id == id);

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

            var model = _mapper.Map <DeviceViewModel>(entry);

            return(View("Form", model));
        }