Questions tagged as 'linq'

2
answers

Adding CSS to the Grid Registry

I'm trying to add a bold to a record in the grid, but it appears as " <b>Nome</b> " and not " Name " as it should. I'mdoingthisforcodebehind,throughLINQHere'smyViewUltimateShort()method:privatevoidexibirUltimoSorteio(){varapo...
asked by 27.11.2014 / 18:24
3
answers

Get ID immediately after insertion

Use Entity and LINQ. I would like to know how I get a generated ID soon after inserting a record, before anyone else can enter it too, ie ensure that that ID is the one I generated. Has as? Use Sql Server 2008, Entity, LINQ     
asked by 26.05.2014 / 17:02
3
answers

Linq filttar elements of LEFT JOIN

I would like to return an object with your children, but only wanted to bring the children that corresponded to a certain condition. ex: I have the following classes: public class Fornecedor { public int FornecedorID { get; set; }...
asked by 11.11.2016 / 17:29
2
answers

What is the simplest way to retrieve certain elements of an XML with Linq?

I have the following XML : <clientes> <cliente> <documentos/> <livros> <livro nome="Nome1"/> <livro nome="Nome2"/> </livros> </cliente&g...
asked by 31.01.2014 / 19:44
2
answers

How to add one more condition in a query using linq?

How can I add one more condition in a join? I have the query below; var consultaVeiculo = (from e in dm.Tabela_SegVeiculos join r in dm.Tabela_VeiculoRefers on...
asked by 05.07.2016 / 21:53
2
answers

Distinct in linq does not work

I made this linq in my model: public static List<MontaArvoreAcao> CriarListaArvoreAcao() { RupturaEntities db = new RupturaEntities(); var _listaUnidade = ( from r in db....
asked by 23.09.2014 / 18:44
2
answers

How to do sort with LINQ with one LISTT inside another?

Apparently easy but I'm not able to do a LINQ that orders two LISTs that are nested. I do not know if the word "nested" is correct. How can I do this sorting through LINQ, in the code below I show where I want to do LINQ. Current Result...
asked by 25.11.2016 / 16:55
2
answers

Deleting Items in List

I have a personal: List<Grupos> lista = new List<Grupos>(); And I have this code var matches = lista.FindAll(x => x.Nome_Grupo.ToLower().Contains(txtFiltro.Text)).ToList(); To filter only words from my TxtFilter ,...
asked by 12.05.2016 / 01:22
1
answer

How to change a property during a LINQ query?

Is there any way to change a LINQ query property of the query itself? Ex: I'm doing a query on List<Cliente> and I want all clients whose NomeFantasia starts with * to have the symbol removed from the name. Her...
asked by 14.08.2015 / 14:48
2
answers

How to capture assembly from classes that inherit from a single class

I have numerous classes. All inherit from a single class public abstract class ClasseBase { public int Id {get;set;} } and other classes: public class Teste1 : ClasseBase{ } public class Teste2 : ClasseBase { } You would need to...
asked by 04.12.2014 / 18:56