protected override async Task OnInitializedAsync() { try { Ambiente = await AmbientiDataService.GetAmbienteDetail((int.Parse(AmbienteId))); } catch (Exception) { throw; } }
protected override async Task OnInitializedAsync() { Saved = false; int ambienteId; int.TryParse(AmbienteId, out ambienteId); if (ambienteId == 0) //new ambiente is being created { //add some defaults Ambiente = new Ambiente(); } else { Ambiente = await AmbientiDataService.GetAmbienteDetail(ambienteId); } }