Questions tagged as 'lambda'

1
answer

Execute lambda expressions from an "unknown" type

In a development that I am doing, I create a type of object from one of my classes that are stored in my library in the following way: var type = GetTypeFromAssembly(typeName, fullNameSpaceType); var instanceOfMyType = Activator.Crea...
asked by 13.10.2016 / 21:23
2
answers

Using lambda expressions in Java

I am practicing Lambda expressions and I have the following. I have a person class: private static class Persona { public int a; public String b; public Persona(int a,String b){ this.a=a; this.b=b; } pub...
asked by 16.05.2017 / 06:06
2
answers

Using .Zip or linq in c # to add two fields from a series of objects contained in two lists

I have a list of objects List<Objeto> lista1; List<Objeto> lista1; Object has an attribute X and an attribute Y . I want to do the following: List<Objeto> listaSuma => add the values Y o...
asked by 11.01.2017 / 15:17
1
answer

Lambda expressions - sum

I'm working with lambda expressions but I have a problem I have this method: public static void Test_LambdaExpresions() { var albums = new List<Album> { new Album { Quantity = 10, Artist = "Betontod", Titl...
asked by 25.09.2018 / 01:32
1
answer

How can I pass this to a lambda expression?

I want to do this in a code that only takes one line, who can help me would be great. long processSize = 0; Process bProcess = null; foreach (var process in Process.GetProcessesByName(name).Where(x => x.PagedMemorySize64 > processSize))...
asked by 08.08.2016 / 23:43
1
answer

Filter by class without using stream when reading an array of objects with Java lambda expressions 8

I'm testing the Java 8 Lambda expressions. In my code I create a list of objects that can be of type Person or type Employee . The class Employee extends from Person and I want, using a lambda expression to displ...
asked by 07.07.2018 / 06:48
1
answer

Java 8 List Get non-repeated items from a list

Case 1: I have a List with a series of elements that can be repeated. List<String> nombre; nombre.add("Persona 1"); nombre.add("Persona 1"); nombre.add("Persona 1"); nombre.add("Persona 2"); nombre.add("Persona 3"); ... Is i...
asked by 12.04.2018 / 11:46
3
answers

Pass parameter in task using lambda

I have this afternoon ... void TareaFecha() { Task T = new Task(() => { DateTime FechaActual = DateTime.Today; DateTime Inicio = FechaActual.AddDays(8); MessageBox.Show($"TareaFech...
asked by 19.10.2017 / 16:54
1
answer

Is it possible to declare local variables within a lambda?

I have a lambda function (arrow or anonymous function) in JavaScript , which declares a variable, but the problem is that it declares it as a global variable, and I I would like it to be local (only accessible within lambda). (x=>(...
asked by 21.03.2018 / 03:32
1
answer

count records in a table

Good I need to show a count I am working with a listing and lambda as follows: @foreach (var item in Denuncias) { var DenunciaPersona = dbDP.TraerTodo().Where(x => x.NODENUNCIA ==...
asked by 18.12.2017 / 22:31