Questions tagged as 'linq'

0
answers

How to improve the loading of related entities using LinqKit?

Hi, I'm using LinqKit to stack "Expression Predicates", so I need to do a "foreach" to do the entities Load related and this is being very costly for application because to load 1000 records is taking in average 4 minutes. Is there any way to...
asked by 28.05.2015 / 05:49
1
answer

Linq Query dynamics between two contexts

I'm trying to return the following sql query but to no avail. SQL= select IDEstado, COUNT(IDEstado) from PessoaEstado w join Nucleo.dbo.Estado e on e.ID = w.IDEstado where IDPessoaMaster = 46 group by IDEstado Code= var dbApp = new App(); v...
asked by 16.05.2014 / 22:28
1
answer

Return in the view more than one data list

In my return view (), how can I return two or more lists? These lists are the results of a linq query.     
asked by 18.09.2014 / 19:52
1
answer

Windows Mobile 5 error reading XML

I'm having diviculties in getting the values from the following XML <ArrayOf xmlns="http://schemas.datacontract.org/2004/07/WcfServicePedido_v7" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <V> <D>S<...
asked by 07.03.2014 / 20:13
3
answers

NullReferenceException error in join

I created a join in LINQ to create a List : (from p in listaProcedimento join pd in oListaprocedimentodetalhe on p.codigo equals pd.codigoProcedimento into pd1 from pd2 in pd1.DefaultIfEmpty() select new ProcedimentoDe...
asked by 02.08.2017 / 13:42
1
answer

JOIN by LINQ in C #

I need to join LINQ in two lists using codeList. List 1 must exist in the second list (list 2) and needs to be returned. How do I do that? Note: I've never done join via LINQ in C #     
asked by 27.07.2016 / 00:48
2
answers

Write XML from a List

I'm developing a C # Console Application that loads a List and then writes an XML file to the contents of this List. Class public class Equipamento { public int Id { get; set; } public string Marca { get; set; }...
asked by 15.02.2016 / 22:38
2
answers

Why does .all in an empty list return true?

I was having an error in a business rule, and by investigating, I came up with the following code snippet, which is intended to check if all processes in a list are active: return processos.All(proc => proc.Ativo) When debugging,...
asked by 12.07.2018 / 20:26
2
answers

How to sort and list only 5 items in a list?

Well, I'm developing the dashboard of a web system, in one of the filters I should list the top 5 clients and sort them by the highest amount of totals of invoices issued. I'm already able to list quietly, the problem is that the filter is listi...
asked by 24.05.2018 / 20:37
1
answer

Lambda or Linq brings me all the field and not just those of the expression

Just for learning, understand the section. I made a lambda from a bank with only 6 fields, like this: public List<LiberacaoDTO> getAutoriza(int idorcamento) { var lista = contexto.Liberacoes .Where(m => m.IdOrcamen...
asked by 27.08.2017 / 23:00