Questions tagged as 'linq'

2
answers

Update data using LINQ

I've read that LINQ should be used for queries, but in the context below, the best way I found to update was using let . var produtos = from o in orcItens join p in Produtos on o.Id equals p.Id let x = p.Estoque -= o.Quant...
asked by 02.01.2016 / 02:18
1
answer

Find data from related tables

I know that to return the values of a directly related entity in the database is done with LINQ: List<Usuario> lista = banco.Usuario.Include("Tipo").ToList(); But how do I get the data back from another table related to the "Type" tab...
asked by 26.05.2015 / 14:06
1
answer

Manipulating ListView C #

I have a ListView that displays the data on the screen and has multiple rows and columns. For example: Cl1 | Cl2 | Cl3 L1 aa | bb | cc L2 ab | bc | cd L3 ac | bd | ce I would like to know if you have some native...
asked by 03.12.2014 / 21:09
1
answer

How to concatenate properties of a single List with LINQ?

I need to concatenate two properties of each item in my list, in the example below it works but would like to know how I can do the same thing using LINQ instead of foreach ? public partial class Form1 : Form { public Form1() {...
asked by 05.03.2015 / 13:27
1
answer

C # - Multiple keys in JOIN LINQ Lambda Expressions

I have an SQL like this: SELECT * FROM KY_AR_SOLICITACAO A JOIN KY_AR_SOLICITACAO_ITEM B ON A.NF_ENTRADA = B.NF_ENTRADA AND A.SERIE_NF_ENTRADA = B.SERIE_NF_ENTRADA AND A.NOME_CLIFOR = B.NOME_CLIFOR And in my ASP.NET MVC project, I want to m...
asked by 05.10.2018 / 13:36
1
answer

What's the difference between using "equals" vs == in LINQ to Entities?

As I mentioned above, when I say equals of LINQ to Entities I'm referring specifically to the C # reserved word and not to Equals() of System.Object . Source: equals (C # Reference) The following example returns all...
asked by 06.12.2018 / 23:34
2
answers

Lambda Expression X linq

Speaking in terms of performance in the whole (speed, integrity and etc ...), use lambda expressions to query database, is it better in terms above or not or depends?     
asked by 05.06.2014 / 22:06
1
answer

Complex linq query when passing parameters

I need to do a linq query, but I'm having a hard time doing it. I have 5 filters on the page. Being that three of them come from three dropdown (select). I can only consider select, if the text in them are different from "NO FILTER", first step....
asked by 26.06.2014 / 14:17
1
answer

How to do a SUM in different table fields in the Entity Framework?

This is the SQL that I have as an example, would you like to do the same with Linq ? select SUM(iv.precoMediano * oi.quantidade) as total from orc_orcamentoItem oi inner join orc_insumoValor iv on oi.codigo = iv.codigoSinapi where...
asked by 05.10.2017 / 15:17
1
answer

error left join linq

I can not access the methods of a child class that was created using database first: namespace Dados { using System; using System.Collections.Generic; public partial class pessoa { public pessoa() {...
asked by 01.06.2017 / 14:20