Posts by Arão Benjamin • 61 points
5 posts
-
0
votes3
answers92
viewsA: Linq C# with order
Linq does not guarantee order maintenance, so you can use a trick. Ramal[] RamalAniver = (from a in db.Ramais where a.sAniversario.Contains(DiaAniversario + "/" + MesAniversario) && a.bAtivo…
-
1
votes1
answer191
viewsA: Run method of one nested class as property in another in C#
Still, basically the problem is that you’re trying to invoke a method from an object that doesn’t exist yet. In its definition of class Exemplo, you have a property of the type IFeliz not yet…
-
0
votes1
answer137
viewsA: Convert SQL query to LINQ
Alessandre, to define the Linq expression, you need to have access to the table, through a Dbcontext or something similar. But assuming there’s a variable db with access to and a Tabela, the code…
-
1
votes3
answers1181
viewsA: How to access the elements of a list declared in a different class?
Daniel, your method of public void GenerateList(int Length) has an important problem. Because the local variable Numbers is never used, in fact. It has an allocated memory like a List<int>, is…
-
1
votes1
answer358
viewsA: sum column lambda expression
If what you need is just the sum of valor_negocio, then you can discard the operator select, because it is only used if you want to return data from each record: var somaValorNegocio = (from a in…