Most voted "lambda-expressions" questions
A lambda expression is an anonymous function that you can use to create delegates or expression tree types.
Learn more…305 questions
Sort by count of
-
0
votes1
answer488
viewsDelete a foreach and replace the result in a lambda expression in a method
It’s pretty simple stuff. I have a method that takes a name inside a database and compares it with the parameter passed in the method and be equal, return it in the method, otherwise return a…
-
0
votes1
answer59
viewsHow to use round in lambda function
I want to understand how I can include the round in the following role: lstNumerosF = [10.01, 7.03, 2.23] lstMapa = list(map(lambda x: x ** 2, lstNumerosF)) print(lstMapa) I wanted to use inside the…
-
0
votes1
answer251
viewsLoad list with Entity
The following. I created a context class inherited from DbContext. public class SiloContext : DbContext { public SiloContext() : base("inetConn") { } public DbSet<Produto> Produtos { get; set;…
-
0
votes1
answer236
viewsLambda or Linq brings me all the fields and not only those of expression
Just for learning even, understand the section. I did a lambda of a bank with only 6 fields, like this: public List<LiberacaoDTO> getAutoriza(int idorcamento) { var lista = contexto.Liberacoes…
-
0
votes2
answers366
viewsReturn an object from two or more tables to the fields
I have done some posts on Rest and Lambda, and to give a close on this subject(I hope), I have a question. A colleague here at the site recommended that I create a DTO and bring the database data…
-
0
votes3
answers39
viewsCast error while running the Rest service
I’m making that mistake: The 'Qtde' Property on 'Itenslib' could not be set to a 'System.Double' value. You must set this Property to a non-null value of type 'System.Single'. What can cause it?…
-
0
votes1
answer128
viewsFilter Json from the bank using Lambda C#
I’m starting development and I’m in need of some help. I got this Json I’m getting from the bank. But I need to filter the information by name for my return method. E.g. If the name = "Percent…
-
0
votes1
answer44
viewsError in expression
Can anyone help me with the following mistake? Here below is my code. I am trying to fix this error, but I did not succeed. public IEnumerable<Dia1> GetPendenciasByUser(int centroId) { var…
-
0
votes2
answers159
viewsHow to use the Where clause with Inno?
I need to make a Join between the person and people tables so that the core Entity Framework brings a corresponding record. Let me be clearer: In the personal tableentity, I sort my register of…
-
0
votes1
answer82
viewsKotlin + RX Observer without Anonymous
I’m studying Kotlin Android and RX and I only see examples like : val api = StarWarsService() api.loadMovies() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( {…
-
0
votes1
answer91
viewsC# - Asqueryable - Condition (Linq - Lambda)
In this method, I populate my 'rule' variable with all rules coming from Select, however, I would like to filter only Status = True. How to do this? public async…
-
0
votes2
answers212
viewsSearch in lambda query with logical operators
I have a query for a report, where some search fields are optional, except the date ranges. However, when performing the query, the function always returns me values that do not match the parameters…
-
0
votes0
answers110
viewsGroup with Lambda, ASP.NET MVC
I have a question here. I have a action which receives two parameters, two dates. This generates a list, but in this list, the same item is repeating. wanted to be able to make a sum of money. For a…
-
0
votes1
answer112
viewsSearch Object By date and Id Lambda, Linq, Asp.net
I have class called Requisicaodeveiculo, a class called Moving vehicle and class Vehicle. class RequisicaoDeVeiculo { public int Id { get; set; } public DateTime DataDaSolicitacao { get; set; }…
-
0
votes1
answer415
viewsUsing Elements like "Not Exists" and Sub Query in LINQ, LAMBDA EXPRESSION and Nhibernate
Good Morning, I have a query to be executed in my database, however, here in our projects we use Nhibernate as a ORM tool. I’m having difficulty passing this SQL query to a syntax used with…
linq lambda-expressions nhibernate fluent-nhibernate linq-to-sqlasked 6 years, 2 months ago Italo Angelo 3 -
0
votes1
answer443
viewsHow do I pass a lambda function as a parameter?
I’m doing a college project where I have to develop a calculator with Java. I am trying to find a way to pass lambda functions as a parameter so that it is possible to put these functions inside a…
-
0
votes0
answers161
viewsGet value from an entity via navigation property
I have a question that seems basic, but I’m racking my brain to solve. How can I get the value of an entity attribute via Properties Navigations? For example, I have the classes: public class Budget…
-
0
votes1
answer303
viewsHow to do a search with Join using Entity framework Lambda and Linq
How do I search two or more tables. In the system I am doing, I have the tables Barco, Tipodeoperacaodobarco and Classebarco My mapping is as follows: HasRequired(c => c.ClasseBarco) .WithMany(c…
-
0
votes1
answer79
viewsCan someone explain that code to me?
There is this following code and I’m very confused about it, even fiddling with javascript, I tried debugging but I put a console.log inside the function in the variable "T" and it printa truth,…
-
0
votes1
answer49
viewsReturn of a single element from a list to a LINQ
I’m taking elements from a list and I can’t erase the elements, I have to return them all. I found a problem at the end of this query, where you have the comment //Erro…
-
0
votes2
answers65
viewsHow to do a parallelism or asynchronous call in a lambda
I have this query qry.ForEach(q => { var product = new Product(); product.CategoryId = q.CategoryId; product.AuthorizeMaximumPercentageAlteration = q.AuthorizeMaximumPercentageAlteration;…
-
0
votes2
answers42
viewsHow to load Enum property into a Lambda
I own property like that public CustomerTypeRequest Type { get; set; } That guy(CustomerTypeRequest) is an Enum, as below public enum CustomerTypeRequest { Guest = 0, //Visitante anônimo Customer =…
-
0
votes1
answer73
viewsdifficulty making Foreach lambda in a query
I have this query var qry = _productRepository.Table.GroupJoin(_categoriesRepository.Table, p => p.CategoryId, c => c.Id, (p, c) => new { Product = p, Categories = c.DefaultIfEmpty() })…
-
0
votes1
answer100
viewsVirtual property is not instantiated in lambda
When I took a code to improve performance I had the following. A method GetAll() this method populated a var. It was made a foreach in this var and was assigning the appropriate values. It happens…
-
0
votes1
answer30
viewsHow can I identify if 2 Hashmaps have Objects with Common Ids
Right now I’m playing a card game, in which each Player has an inventory of his Cards. I am now trying to create a Deck and my goal is to make the Cards that are already in the Deck not appear on…
-
0
votes0
answers38
viewsQuery with Leftjoins using Groupby Includes are not performed EF.Core C#
I need to perform a query with the Entity framework where I have an entity Offer and in it I have several Cards (Entity). In the query I am performing the card include, and using Selectmany to…
-
0
votes0
answers45
viewsCount number of Users
I have a Client class, and a Systems Class. A customer has one or more systems: public class ClienteEmpresa : Pessoa { public virtual ICollection<TipoDeSistemas> TipoDeSistemas { get; set; } }…
-
0
votes1
answer37
viewsIcollection property in class is not instantiated
I have the product class and in that class I have this property public virtual ICollection<CspProduct> CspItems { get; set; } Here we take the products var products =…
-
0
votes1
answer24
viewsMapper.Map Addressmodel.Citysmodel Endereco.City
I have the class Addressee public class Endereco { public virtual Cidade Cidade { get; set; } public int CidadeId { get; set; } } And I got the Viewmodel Of That Class: public class…
-
0
votes1
answer283
viewsMap function with lambda in a list of Python dictionaries
Good evening, I’m taking the data via API and turning it into a . JSON to record in a list:. Inside this info is a list of dictionaries called custom_fields, so I used map with lambda function to…
-
0
votes1
answer69
viewsHow to use SQL "in" in a lambda (Entity) C#?
I have a repository that represents my table in the database var RelacaoPessoas = _repositoryPessoas.GetFiltered(i => i.IdProcesso == idprocesso && i.Banco == numeroDoBanco &&…
-
0
votes1
answer164
viewsJSON to String API GATEWAY ( AWS )
I need to receive a JSON in my API GATEWAY and pass to my LAMBDA ( GOLANG ) a STRING, The Structure Apigatewayproxyrequest the body is String type, when I try to call the lambda passing the json the…
-
0
votes1
answer90
viewsReplace this for with a Lambda solution
I’m studying lambda and wanted to change this solution of for who owns a break. The solution today suits me, however I wanted to know if the way I am using is ideal or there is a better. Basically…
-
0
votes1
answer52
viewsHow to sort a list 1 to N with Expression lambda
I need to sort out a list and I don’t know where to start. I tried to apply the code below based on some posts, for example: https://stackoverflow.com/questions/298725/multiple-order-by-in-linq ,…
-
0
votes1
answer40
viewsWhat is the correct way to use AWS Iot.describeCertificate()? I cannot access the function asynchronously
I need to regain the status of an AWS-Iot-Core certificate using a Lambda function with Nodejs. According to the official documentation would need to use the function describeCertificate(). This is…
-
0
votes1
answer272
viewsTracerouter in python error:<lambda>() Missing 1 required positional argument: 'r'
Someone could assist me here, I spent a few days trying to solve this business in my code and unfortunately I could not solve. The operating system I am using is Windows 10. My problem is on the…
-
0
votes2
answers45
viewsFind a lower value of a collection, according to one condition
I have two collections: A and B as List<int>, both of the same size N. In collection A, are the designs. In B, the offerings by the project. Illustrating: projects[5, 1, 4, 5] offers[8, 7, 6,…
-
0
votes1
answer61
viewsC# LINQ Join with OR condition?
I need to write this SQL in Linq, but in that condition JOIN is what gets me. SELECT * FROM Boleto_Retorno AS BR LEFT JOIN Recebimentos AS R ON SUBSTRING(BR.CH_NossoNumero,1,11) = CASE WHEN…
-
0
votes1
answer39
viewsWhere the return is List<List<String>> convert this result into List<String> only by combining the elements
Considering the implementation below: fun main(list: List<String>) { val x = list .stream() .map { findMessages(it) } .collect(Collectors.toList()) } fun findMessages(s: String) :…
-
0
votes0
answers27
viewsConversion error in Where clause when filtering records using EF Core 2.0
I’m getting a list of records and filtering according to the given parameter. The problem is that an error is appearing in which I do not know (as picture). There are two classes : Personal Document…
-
-1
votes1
answer55
viewsPossibility to use MAX in Datetime Lambda expression fields
There is the possibility to use the MAX in expression consultations lambdas, for example: I would like to take all registration at the age of 18 years and get the only last record entered in the…
-
-1
votes3
answers59
viewsConvert inside a lambda
I have a nullable int field and that within a lambda I need to popular a nonnullable property. If I do this: campo1 = Convert.ToInt32(campo2); I take this mistake: Notsupportedexception: LINQ to…
-
-1
votes1
answer24
viewsHow to display elements of specific sizes belonging to a list using lambda and filter functions?
In that code I wrote: lstNomes = ["casa", "google", "escola"] lstFiltro = list(filter(lambda x: x <= "5", lstNomes)) Is returning the empty array: [] I wanted to know how I get the element inside…
-
-1
votes1
answer50
viewsC# Lambda function with multiple validations, checking using contains with multiple comparisons
_release is a List with several records x.located is a bool x.Description is a string I’m trying this way if (_lancamento.Where(x => x.Localizado && x.descricao.Contains(new…
-
-1
votes0
answers7
viewsLambda Schedule is running incorrectly
Good afternoon staff I have a lambda Schedule on my aws account that was supposed to run every weekday from 10 to 17 Monday to Friday rate: cron(0/30 10-17 ? * MON-FRI *) #executa A cada 30 minutos…
-
-1
votes1
answer33
viewsMethod/Algorithm for fetching an ASP.NET MVC date
I have the following problem: I’m trying to get a date. I just can’t figure out an algorithm for this. I have a class called RequisicaoDeVeiculo, this class has the attribute DataEHoraDoServico, and…
-
-1
votes1
answer120
viewsI need to find regex to parse a variable
I need to analyze a C code using regex and I’m having trouble knowing if a variable is receiving a float or integer value. Ex: valor_01 = ( 5 * 3 ) / 2.5 + ( 4 % 3 ) ^ 4 ; valor_01 can be any…
-
-1
votes1
answer42
viewsHow to get the amount of multiple properties on a list?
I have a list that has over 10,000 Curriculum Grades. Within Curriculum Grade I have the name of the Discipline and the Teaching that it is There are 15 subjects that can be repeated for each…
-
-1
votes1
answer37
viewsC# Lambda for Java Lambda
I have this code in C#. A lambda expression that searches for files in a directory using regex and plays those files in a function by running a command line. All found files are added in "Task" to…
-
-2
votes1
answer70
viewsDoubt of licking on a guy
How do I make a lambda to bring only records that contain the word Transfer? For example, in my example, there are 19 records, but 3 are not Transfers, so it should come 16. Below my code and my…