public IEnumerable <PerfilModel> Get([FromQuery] PerfilQO perfil) { try { return(PerfilService.GetComParametro(perfil)); } catch (Exception) { throw; } }
public IEnumerable <PerfilModel> GetComParametro(PerfilQO perfil) { try { if (!string.IsNullOrEmpty(perfil.NomePerfil)) { return(PerfilRepository.ListPorNomePerfil(perfil.NomePerfil)); } else { List <PerfilModel> listPerfil = new List <PerfilModel>(); listPerfil.Add(PerfilRepository.Find(perfil.PerfilId)); return(listPerfil); } } catch (Exception) { throw; } }