private Smc CreateSmc(SmcDto smc, KeysDto keysDto) { smc.KeysDto = keysDto; smc.SmcModel = _smcModelService.GetByName(smc.SmcModel.Name); var status = _smcForwarderService.ForwardCreation(smc); if (!status.IsSuccessStatusCode) { throw new BadRequestException(JsonConvert .DeserializeObject <ErrorMessageDto>(status.Content.ReadAsStringAsync().Result).ErrorMessage); } _smcService.Save(smc); return(_smcService.GetExistingSmc(smc.Serial)); }
public IActionResult Save(SmcDto smcDto) { SmcDto savedSmcDto = _smcService.Save(smcDto); _eventService.ASmcWasSavedEvent(this, new IoGServicedEventArgs <SmcDto>(savedSmcDto)); return(new CreatedResult( _servicesUtils .CreateUri( Request, Url.RouteUrl( "GetBySerialSmcRoute", new { serial = savedSmcDto.Serial })), savedSmcDto)); }