public ObjetivoView pegaDadosParaEdicao(string id) { ObjetivoView obj = new ObjetivoView(); try { var resp = objBusiness.listarObjs(id); foreach (var item in resp) { dynamic objVw = item.Value; obj.id = new Utils().convertToString(objVw._id); obj.nome = objVw.nome; obj.dataIniciar = objVw.dataIniciar; obj.dataExpiracao = objVw.dataExpiracao; obj.ativo = (bool)objVw.ativo; foreach (dynamic vlrItem in objVw.listaMiniGames) { dynamic objValue = vlrItem; ObjetivoMiniGameView objMGV = new ObjetivoMiniGameView(); objMGV.id = new Utils().convertToString(objValue._id); objMGV.nome = objValue.nome; objMGV.parametroObjCompletado = objValue.targetForPayment; objMGV.vlrCashIn = objValue.CashPayment; objMGV.ativo = (bool)objValue.ativo; obj.listaMiniGames.Add(objMGV); } } } catch (Exception xp) { } return(obj); }