public async Task <PartialViewResult> Detalhes(string id = null) { var model = default(DetalhesViewModel); if (!string.IsNullOrWhiteSpace(id)) { var doacao = await _usuarioBUS.ObterDoacao(id); var racas = await _racaBUS.BuscarPorEspecie(doacao.EspecieAnimal); model = new DetalhesViewModel(doacao, racas); } else { model = new DetalhesViewModel(); } return(PartialView("_Doacao", model)); }
public async Task <PartialViewResult> Detalhes(string id) { var model = default(DoacaoViewModel); var userBus = new UsuarioBUS(new UsuarioREP()); var doacao = await userBus.ObterDoacao(id); model = new DoacaoViewModel(doacao); return(PartialView("_DescricaoAnimal", model)); }