public async Task <IActionResult> Detail(string airBagId) { var vm = new AirBagDetailViewModel(); //PostBack時 if (TempData.ContainsKey(TEMP_AIRBAG_DETAIL_KEY)) { vm = TempData.Get <AirBagDetailViewModel>(TEMP_AIRBAG_DETAIL_KEY); MergeToModelState(vm); return(View(vm)); } //更新の場合 if (!string.IsNullOrEmpty(airBagId) && int.TryParse(airBagId, out var id)) { var condition = await _service.GetByAirBagId(id); TempLastUpdatedAt = condition.LastUpdatedAt; vm = _mapper.MapToAirBagDetailViewModel(condition); return(View(vm)); } else { return(View(vm)); } } /*Detail*/