Questions tagged as 'linq'

1
answer

I do not know the feasibility of doing in lambda or linq my expression

I have these two lists: List<string> dirZipDireto = ConfigurationManager.AppSettings["Dir_Zip_Direto"].Split(';').ToList(); List<string> arquivos = Directory.GetFiles(caminhoCommiter, "*", SearchOption.AllDirectories).ToList();...
asked by 03.03.2016 / 21:11
1
answer

How to use SQL LIKE [duplicate]

I am trying to put together a string that makes a filter to compare only one piece of a numbering. I tried to make a resource and I looked for several ways to do it and so far I could not. using (NFSeDataContext context = new NFSeDataContext...
asked by 26.02.2016 / 18:22
1
answer

Error with LEFT JOIN in LINQ

My query is returning as error    Additional information: Object reference not set to an instance of an object. When I try to make a category that has no product display "(Non-existent)": var lst = from c in BDProduto.categorias...
asked by 04.09.2015 / 20:40
2
answers

How to return more than one Database Entity in a LIST?

I have two entities, CATEGORY and TRANSACTION , in the database I also have these two tables. TABELA: CATEGORIA CHAVE: ID TABELA: TRANSACAO CHAVE: CATEGORIA_ID When done a select by entity performing a join : var _resul...
asked by 25.01.2015 / 01:17
1
answer

Create a condition within a Linq

I need to make a comparison to set the value within my select new . I'll try to explain better. var tipo= from t in p select new { t.Key, t.Value,...
asked by 25.02.2015 / 19:47
1
answer

How to display bank data in Textboxes?

Hello! My scenario is as follows: I'm developing a web application in C # ASP.NET, and I'm having some difficulties getting the database's data (via LINQ to SQL) to the page controls. Below is one of the controls in my .aspx where I...
asked by 15.07.2014 / 15:33
2
answers

Does LINQ to Entities not recognize the 'Boolean Like?

I'm having this error when trying to do one with query using LINQ to SQL after making the suggested changes: {SELECT 'Extent1'.'idcliente', 'Extent1'.'nome', 'Extent1'.'pai', 'Extent1'.'mae', 'Extent1'.'informacao', 'Extent1'.'datanascime...
asked by 06.04.2015 / 16:59
1
answer

Grouping in foreach and view does not work

I created and set one variable to control the following. My LINQ returns me today 5 thousand lines. That variable, it's there to prevent it from repeating the same thing, like. Let's say that the linq returns 400 motif of ID = 1. Soon this varia...
asked by 16.09.2014 / 21:32
1
answer

Nest tag ul in another tag ul with foreach

I have this foreach, which I did with your help here at SOPT. I made it work, but it worked. Only I did it with just one knot. What I'm going to need is this. I have a parent node, inside that parent node a child, inside the child a grandson and...
asked by 16.09.2014 / 15:29
1
answer

Skip list for model

I have a query that returns a list like this: var list = db.Comentario.Where(d => d.GrupoTrabalhoId == Id).OrderByDescending(s => s.DataComentario).ToList(); After this query, it will return me among other things the user id, I would...
asked by 04.12.2018 / 19:27