Questions tagged as 'linq'

1
answer

LINQ Group By with multiple fields in Key

How do I include IdCategoria in addition to the category name in the Console of the first FOREACH ? var lst = from p in BDProduto.produtos join c in BDProduto.categorias on p.IdCategor...
asked by 04.09.2015 / 18:32
1
answer

Error 500 in Asp.Net Library Awesome

I found browsing this library ASP.net Awesome . I found it to be very functional and easy to use. According to the documentation for using a helper named Lookup , you must have a controller and call the helper in csht...
asked by 19.05.2014 / 01:48
2
answers

Remove objects from memory

I have DataGridView in my project and a timer refresh of 5 seconds. I realized that the system was overloading the memory, because every time I list the previous data, they remain in memory. This is the code I use to list: Using (DBE...
asked by 03.02.2015 / 12:19
1
answer

How to concatenate fields in linq and rename

I made a linq and it is not working the concatenation and the rename of it. See: var monta_arvore = (from rup in db.Ruptura from apr in db.Apresentacao.Where(ap => ap.Codigo_Apresentacao == rup.Codigo_Apres...
asked by 09.09.2014 / 21:38
2
answers

How to use Distinct () or GroupBy () in a list that returns an anonymous type?

I'm doing a select in the bank to bring the IdNavio and Navio , but I do not want to bring the repeats. I am trying to use the Distinct() and GroupBy() methods, but they are not working, I am using the names...
asked by 09.02.2018 / 12:38
1
answer

Do a query and see in a dropdownList

You are giving the error below in dropdowList and I do not understand why. Error:    Can not bind the object of type 'System.Collections.Generic.List1 [
asked by 15.12.2015 / 17:42
2
answers

Select with Linq set the first characters in the where

How can I set in Linq the same as I define in the Where do sql server clause of the form below .. select * from tb_CentrosCusto cc where cc.Clasificacao like '1.4.1%' In other words, I'm trying to find out what's going on with...
asked by 13.11.2015 / 15:14
1
answer

Query using LINQ and Generics C # [closed]

I'm having trouble running a LINQ query using Generics. Something like: from x in session.Query<T>() " ??? " My method receives two strings as parameters, columnName and search value. public virtual object PesquisePorColunaValor(...
asked by 22.09.2015 / 20:42
1
answer

Assign property value of an object to a list of objects

I have a list of objects: List. Well, this object has three properties, say, cnpj, action, and newness. I made a linq or lambda and it brought me all the results, say two lines. I make a foreach in the result of linq or lambda and how do I now a...
asked by 28.05.2014 / 15:56
2
answers

Add subitems between groups with linq

How can I perform calculations between subitems of a group by query in linq? Here's an example: Linq Query var listPlanoDeContas = (from t in _planoDeContasRepository.GetAll() orderby t.Month ascending...
asked by 23.10.2018 / 18:56