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
-
1
votes1
answer137
viewsWhy use nodejs with asynchronous functions with AWS-Lambda?
AWS-Lambda services can be developed in Java, C#, Python, Go, Powershell and finally Nodejs (DOC). Nodejs is currently used as a backend of applications with the advantage of natively developing…
-
1
votes2
answers209
viewsAdd subitems between groups with Linnus
How can I perform calculations between subsets of a group by query in English? Follow example: Consulta Linq var listPlanoDeContas = (from t in _planoDeContasRepository.GetAll() orderby t.Month…
-
1
votes2
answers548
viewsSend object list to View, by Viewbag Asp.net
I’d like to get some data: Class: public class Produto { public Produto() { this.Categoria = new HashSet<Categoria>().ToList(); } #region Atributos [Key] public int ProdutoId { get; set; }…
-
1
votes2
answers43
viewsObject attributes coming null in Query
Would anyone like to tell me why in my query, the attributes of the COR object, are coming null? I make that same appointment for Sizes, and you bring me the result waiting. however, when making the…
-
1
votes0
answers70
viewsDoubt with LINQ to Entities
What would this query look like in LINQ to Entities: SELECT COUNT(cont) qtde_resp , pergunta , resposta FROM pesq_respostas WHERE id_pesquisa = 9 AND Tipo IN ('Intervalo', 'SimNao') GROUP BY…
c# sql entity-framework lambda-expressions linq-to-entitiesasked 6 years, 1 month ago alessandre martins 998 -
1
votes1
answer179
viewsTransform Sql command into LAMBDA
I’m learning a little about LAMBDA and tried to convert this query into LAMBDA, but I stopped. I have 2 classes: public class Voo { public string idVoo {get;set;} public DateTime dtVoo {get;set;}…
-
1
votes0
answers213
viewsAdd new values to an already filled Linq variable
I made that Lambda/Linq: var qry = _productRepository.Table.GroupJoin(_categoriesRepository.Table, p => p.CategoryId, c => c.Id, (p, c) => new { Product = p, Categories = c.DefaultIfEmpty()…
-
1
votes1
answer45
viewsHelp in riding a lambda from a foreach
I have this foreach: foreach (var row in responseObject) { if (row.CDOrigem == request.CentroDeDistribuicaoId) { if (row.FaixasPreco == null || row.FaixasPreco.Count() == 0) { var uniqueItem = new…
-
1
votes0
answers107
viewsHow to put one more condition in the Join on clause in a Linq/Lambda query
This query I run in the bank and is working as it should select rci.markuppercentual from resellercatalogitem rci join [Order] od on rci.ResellerCatalogId = od.ResellerCatalogId join OrderItem oi on…
-
1
votes1
answer151
viewsC++. Generic class receiving lambda and struct function
Expensive, I’m trying to do some things in C++, but I’m still starting both in language and in the functional paradigm. What I need is to insert a function lambda in a pair. The first member of pair…
-
1
votes1
answer119
viewsConvert Iqueryable to a type
I made that code OrderItem itens = new OrderItem(); var items = _orderService.GetItemsFromOrder(orderId); itens = items.Where(x => x.CurrencyCode == 23).Select(s => new OrderItem { ProductId =…
-
1
votes1
answer147
viewsSubquery with entityframework lambda
I have this select which on the basis of it was made in the entity framework select PedidoVenda.Id, Funcionarios.Nome, FaturaContasReceber.FaturaContasReceberPId, FaturaContasReceberP.TotalFatura,…
-
1
votes1
answer81
viewsReturn lambda value and not lambda mounted query
I did that lambda OfferUri = OfferUri.Select(s => s.Items.Where(a => a.SubscriptionId == s.Id).Select(n => n.Id).FirstOrDefault()).ToString() and when I see what she returns to me, I have…
-
1
votes2
answers40
viewsUsing Intunaryoperator Java Interface to return n functions
I am reading the documentation of this bookstore that is in the title. I want to implement a method that returns a composition of functions, if I not by arguments must return the identity function,…
-
1
votes1
answer30
viewsHow to call a function more than once in a lambda Expression?
In Jenkins I’m trying to read a file with groovy and for each line check if it contains any of the information I need. Given the following content of arquivo: amarelo verde vermelho azul The code I…
-
1
votes0
answers125
viewsUnion All for Entity framework using Lambda
I’m having problems in a query using lambda and Entity Framework in C#. When transforming a simple sql query into lambda works perfectly, as example below. SQL query public DataSet ListarRecebidos()…
-
1
votes1
answer41
viewsInclude a character in an excel python values
I have a dataframe whose column has 12 characters. However most on the left are zeros and at the end of it I have the values. Examples: I’m trying to include a comma or dot before the last 2…
-
0
votes2
answers623
viewsDoubt on how to select a record via Inq
I have a chart, where I only record scripts. There is a field, where I separate whether it is technical script or central script. There is a field TipoScript char e is "C" or "T". This table was not…
-
0
votes1
answer543
viewsHow to perform actions at a given time using Ruby on Rails
In my project I would like to create alerts that run at each given interval or at a certain date, Some way to do, using as little memory as possible?
-
0
votes1
answer66
viewspick up customer with certain types of purchases
I have these tables: Sales : Idvenda(int)PK, Datavenda(Datetime), Qdeitem(Decimal), Valuation(Decimal). Iditem(FK),Idcliente(FK) Item: Iditem(int)PK,Descricao(Varchar),Valoritem(Decimal)…
-
0
votes1
answer90
viewsProperty is coming as Undefined
In the controller I have a lambda that returns me three fields. When I run in jquery it tells me that the property is Undefined. I think it’s the way I try to take the amount. Can someone give me a…
-
0
votes2
answers98
viewsHow to avoid code redundancy in these two methods, one having a Ienumerable<> parameter and the other not?
How can I simplify these two methods in order to prevent code repetition? Method 1, with the first expression having a generic property of type Ienumerable<>: public GenericDAO<TModel>…
-
0
votes1
answer37
viewsI do not know the feasibility of doing in lambda or Linq my expression
I have these two lists: List<string> dirZipDireto = ConfigurationManager.AppSettings["Dir_Zip_Direto"].Split(';').ToList(); List<string> arquivos = Directory.GetFiles(caminhoCommiter,…
-
0
votes3
answers4347
viewsCheck if the item exists in a List<>
I have a list typed in C# and I need to search for an item through several filters. I demonstrate in codes: List<LoteRecla> listLoteRecla = new List<LoteRecla>(); I tried using the…
-
0
votes1
answer437
viewsHow to iterate over a stream from a list that has an array and return if true?
How do I get the Enum object with an ID I passed as parameter check an Enum object element if true? My builder: private WeaponInterface(int[] weaponId, int speed, FightType[] fightType) {…
-
0
votes1
answer71
viewsLoad variable with Split Expressions by scrolling through a list
First I made this code: for (int i = 0; i < vlstAcessos.Count - 1; i++) { if (vlstAcessos[i].DsURLTransacao == "frmANAAguardeProcesso.aspx") transacaoANA = vlstAcessos[i].DsURLTransacao =…
-
0
votes1
answer7455
viewsHow to use group by in LAMBDA
I have a product table: int id string descricao int quant Here’s what I wanna do: select descricao, sum(quant) from produtos group by descricao How to make the above query in lambda?…
-
0
votes1
answer277
viewsLINQ to Entities x Lambda Expression
What is the difference between LINQ to Entities x Lambda Expression? Still using LINQ to Entities in the Entity Framework or is there something new?
-
0
votes1
answer301
viewsReturn date x days left to arrive
Scenario: Ciclos id name endDate (datetime?) Dice: 1, primeiro, 05/10/2017 2, segundo, 15/10/2017 3, terceiro, 20/10/2017 4, quarto, 30/10/2017 With Line and lambda, I would like to return the dates…
-
0
votes2
answers1454
viewsapply filter in return from a list
I’m making an appointment where I have one array of situations ex: 1, 2, 3 in the query I have to filter through these situations, follow my code. var array = GetSituacoes(); var lista = bll.Query(p…
c# entity-framework linq lambda-expressions linq-to-entitiesasked 7 years, 8 months ago Thiago Ubiratan 353 -
0
votes1
answer50
viewsHow to query an AWS RDS service through the AWS API?
I have an AWS RDS service database and an API on AWS API GATEWAY services. One of the data request options when creating methods is to use other AWS services. Researching this post i saw that it is…
-
0
votes1
answer684
viewsSyntax of the Lambda function
I’m right at the beginning of the Lambda function study and I’m pretty much lost. I know the code could be done only with the "sum" function but I want to learn the Lambda syntax. a = [] for b in…
-
0
votes1
answer651
viewsFilter a NULL type in lambda Expression or Line
Hello, my entity To has a long type attribute that can be NULL making relationship with the entity B, by making a filter with a Lambda expression with this attribute to bring all records that are…
c# asp.net-mvc linq asp.net-web-api lambda-expressionsasked 6 years, 10 months ago Thiago Ubiratan 353 -
0
votes1
answer20
viewsAWS - Start Second Instance Via Cloudwatch
Hello, I have a scenario with 2 instances, in a "load balance on iis - Windows Server", but most of the time, only one instance holds the load. Therefore, the client requested me, to keep the second…
-
0
votes1
answer48
views0.. 1 to 1 modeling in the Entity Framework - Error The Entity or Complex
I’m trying to make a query but returns the error: Additional information: The Entity or Complex type 'WMB.CieloB.Model.Cielotoken' cannot be constructed in a LINQ to Entities query. My consultation:…
-
0
votes1
answer29
viewsLamda functions - How do I loop AWS-Stepfunctions - with Nodejs?
I have a function lambda, F1, in Nodejs whose main objective is to read the contents of a file that is deposited in S3 through another process. Let’s say in this file there are 10 products. I need…
-
0
votes1
answer134
viewsWhat are the advantages of using AWS-Stepfunctions?
Since there is already a system or processes in progress (all functional) with AWS - Lambda functions what would be the advantages or disadvantages of bringing these processes to step functions,…
-
0
votes1
answer272
viewsDynamic filters using lambda
I have a table Errosproducao_records linked to another table called Errosproducao_tipos. I need to perform dynamic filters in the table Errors_records using lambda expressions. if I perform the…
-
0
votes1
answer32
viewsHow to write this query using lambda Linq in c#
The query I have to pass to lamba is as follows: select * from Linguagem inner join Cadastro on Lin_ID=Cad_IDLinguagem and Cad_Situation=0 only coonsegui do until the part of the joint but Where do…
-
0
votes1
answer121
viewstuple Parameter unpacking is not supported in python 3
I started studying Python now and came across this mistake tuple parameter unpacking is not supported in python 3 Below is the excerpt of the code: #cria uma lista(user_id, numero_de_amigos)…
-
0
votes1
answer32
viewsJoin in four tables using LAMBDA
I’ve been banging my head for two days to join with LAMBDA on these tables. I am creating a SESSION for my user in ASP.NET Core, before passing my object to JSON, I need to JOIN these tables.…
-
0
votes2
answers526
viewsApply a function to each element of a python matrix
I need to apply a lambda function to all elements of a matrix in and it returns a matrix of the same size type like this: i have the matrix mat in numpy style: mat = array[[1, 2, 3], [4, 5, 6]] and…
-
0
votes1
answer137
viewsLambda function to return higher value from a list of dictionaries
Good evening. Could someone explain to me how the lambda function below works? I’m not understanding why it returns the highest value in the dictionary. Another thing I’d like to know, the 'x' is…
-
0
votes1
answer474
viewsImplementation using API-Streams and API-Lambda Java 8
Good Staff. Trying unsuccessfully to solve a proposed exercise using the new features of the java 8 Lambda and Streams Apis. In this exercise you can only create and change methods signature in the…
-
0
votes2
answers22
viewshow to create an udf using two columns and if expression
I’m doing a job using Pyspark and SQL have that function: selection = F.udf(lambda x: cumulative_sum._1 if 100*random.random()<= x, FloatType()) cumulative_sum.withColumn('Selection2',…
-
0
votes2
answers82
viewsPython - is it possible to use lambda in print with format (f or .format)?
I searched for lambda and print and I didn’t find anything I imagined, I mean, it’s possible to do something like this: mil = num//1000 print(f'O número tem {mil} {lambda milhar if (mil == 1) else…
-
0
votes0
answers89
viewsHow to order a Collection according to the Date and Time in C#?
I need to order the Personal Collection? You’re not ordering... Someone knows how to do this? public Pessoa GetJoinById(int id) { var pessoa = Db.Pessoa.Find(id); Db.Entry(pessoa) .Collection(x…
-
0
votes1
answer192
viewsReturn a new object using the Foreach function
Have the following list List<EmployeeTotal> totals = Context.Database.SqlQuery<EmployeeTotal>(query).ToList(); I want to transform all objects in the list totals on a new list of the…
-
0
votes0
answers75
viewsPass lambda expression to another class run C#
Can you pass a lambda expression to a class, and then execute it ? Something like code below. Giving error in the expression select new Error: Error 1 Cannot implicitly Convert type…
-
0
votes2
answers57
viewsName of the Linq Dynamics column?
I have a column that will receive the orderBy dynamically, by example: _context.Tabela .Where(p => p.colunaA.Contains(searchBy) || p.colunaB.Contains(searchBy) || p.colunaC.Contains(searchBy) ||…