Click here to Skip to main content
15,891,529 members
Everything / Lambda

Lambda

lambda

Great Reads

by Ivan Perevernykhata
How to start/stop RDS instances on schedule with aws-sdk, nodeJs Lambda function and CloudWatch
by JIANGWilliam
This is the first of three episodes to introduce considerations and techniques used for the throwable functional interfaces defined in my open-sourced library functionExtensions.
by Randy Kroeger
Created a POC that dynamically builds a predicate using Expression and Reflection.
by Pradip Koli
Using NoSQL DBreeze database with ASP.NET on SQL Northwind Database.

Latest Articles

by P. Erward
How to put the AWS Lambda C++ Runtime into a Lambda layer and how to use it
by egoebelbecker
Create an AWS Lambda in five minutes
by Necmettin Demir
To provide a URL link to access objects in private S3 bucket through AWS Cognito User Pool (using hosted UI), Authorized API Gateway and Lambda in a Secure Way.
by PaulKukiel
Build a Custom PHP MVC in 30 mins and deploy to AWS lambda

All Articles

Sort by Updated

Lambda 

21 Feb 2024 by P. Erward
How to put the AWS Lambda C++ Runtime into a Lambda layer and how to use it
23 Nov 2023 by Mike Breeden
In the past I've been able to be very creative using AJAX in ASP.Net websites, particularly for Intranet Applications. I've been exploring AWS Lambda/Serverless websites which have a great cost advantage, etc. Apparently you cannot use AJAX...
23 Feb 2023 by Hasitha Wijesooriya
I am trying to run my lambda project in Asp.net Core. I attempted several solutions but received the same error. FileNotFoundException: Could not load file or assembly 'File Processing, Culture=neutral, PublicKeyToken=null'. The system cannot...
2 Oct 2022 by egoebelbecker
Create an AWS Lambda in five minutes
9 Jun 2022 by Giuseppe Di Palma
I wrote a telegram bot with aws lambda. I have an Api gateway endpoint which runs the event and triggers the lambda function. Now the problem is that I can't get the "body" because it always returns the same error. This is the request I can get...
21 May 2022 by Necmettin Demir
To provide a URL link to access objects in private S3 bucket through AWS Cognito User Pool (using hosted UI), Authorized API Gateway and Lambda in a Secure Way.
14 Mar 2022 by HRVP
I have one model MaterialModel ID Material 1 MaterialZZZ 2 MaterialYYY 3 MaterialXXX 1 MaterialABC 2 MaterialKKK 2 MaterialVVV 5 MaterialMMM Expected Result (Result Model) ID Count 1 2 2 3 3 1 5 1 I want to group by and take the...
14 Mar 2022 by Maciej Los
Take a look at below code: void Main() { List mm = new List() { new MaterialModel(){ID = 1, Material = "MaterialZZZ"}, new MaterialModel(){ID = 2, Material = "MaterialYYY"}, new MaterialModel(){ID = 3,...
14 Mar 2022 by Luc Pattyn
static void Main(string[] args) { List items=new List(); items.Add(new Item(1, "zzz")); items.Add(new Item(2, "yyy")); items.Add(new Item(3, "xxx")); items.Add(new Item(1, "abc")); items.Add(new Item(2, "kkk"));...
6 Nov 2021 by Richard MacCutchan
You already posted this question at Can anyone convert this Python flask code into AWS lambda?[^], and I explained what the problem is. Please do not repost.
6 Nov 2021 by Richard MacCutchan
Sorry no. This site does not provide free code conversion services.
20 Oct 2021 by User 15041314
{ "message": "The operation was successful.", "code": 200, "fileDetailResponseDtos": [ { "phoneNumber": "550000000", "textMessage": "Message1", "createDateTime": "2021-10-20T15:45:27.277", "sender": "Anar", ...
24 Jun 2021 by bholey
var deleteItems = _EFContext.DbTable.Where(so => so.Identifier == ProviderIdentifier && !string.IsNullOrEmpty(tranType) ? so.TranType.ToLower() == tranType : **true**); _EFContext.DbTable.RemoveRange(deleteItems);...
24 Jun 2021 by Richard Deeming
Trying to push the condition to the database query will result in poor performance. Instead, only add the condition if it is required: var deleteItems = _EFContext.DbTable.Where(so => so.Identifier == ProviderIdentifier); if...
14 Jun 2021 by PaulKukiel
Build a Custom PHP MVC in 30 mins and deploy to AWS lambda
23 May 2021 by Uladzislau Baryshchyk
A walkthrough and source code for creating telegram bot using C# and deploying it on AWS
10 Mar 2021 by RupaT
I am have a lambda function which calls an API and return the data to react where the react prints it in the front end. When I call an API(1) it is working , but for another API its not working. Can someone please help me resolve this? Lambda...
24 Nov 2020 by PaulKukiel
How to build and deploy a Typescript lambda function with AWS CDK and Deno layer
8 Aug 2020 by Vlad Neculai Vizitiu
Mocking/stubbing lambda expressions to have a bit more control over our unit tests
6 Aug 2020 by AramRezaie
I am writing lambda query to get some details from table. I want to get count of each same records with 'UserID' and 'AssetId'. My table structure is as follows. UserID AssetID ProductName ProductLocate...
6 Aug 2020 by F-ES Sitecore
LINQ Count[^]
3 Jun 2020 by Jeremy Likness
A primer on using LINQ to wring strongly typed queries directly in code
2 Jun 2020 by Maciej Los
Start here: Perform inner joins (LINQ in C#) | Microsoft Docs[^] Perform left outer joins (LINQ in C#) | Microsoft Docs[^] When you get stuck, come back here, provide your code, describe your issue and wait for response.
2 Jun 2020 by Member 14169626
How to join three table. I want to select the department id column from the department table of the person.If I want to select the status id from the staff table according to those personid and departmentid. I want to select columns from...
28 May 2020 by Maciej Los
Try: var result = Myentity.Person .Where(x=>x.per==123) .GroupBy(x=>new {x.a, x.b}) .Select(grp=> grp.OrderByDescending(x=> x.d).First()) .ToList();
27 May 2020 by Member 14169626
Select id from table person where per=123 group by a,b having count(*)=max(d) Myentity.Person.where(x=>x.per=123).GroupBy(x=>new {x.a,x.b}) What I have tried: How to lambda expression this query.
27 May 2020 by Richard MacCutchan
Lambda expressions - C# Programming Guide | Microsoft Docs[^]
22 May 2020 by Kamran Saeedi
An idea on how to use .NET ExpressionVisitor to translate lambda expressions into classes that encapsulate data suitable for filtering data & creating query strings
16 May 2020 by phil.o
These are not the same thing. Where expects a predicate as argument which is used to filter the items in a collection, and returns a filtered enumeration. Contains expects an item as argument and returns true or false depending on whether the...
16 May 2020 by Member 14169626
In terms of performance, I want to do using contains instead of where. How can I create the query below without using contains? var t=myentities.Employee.WHERE(x=>x.EmployeeID ==123 && myList.Any(y=>x.BranchID.Contains)).ToList(); What I have...
27 Apr 2020 by Fernando_Costa
Now work. var myvar = Model.Where(_ => _.Status== (int)Status.Yes) .Where(_ => _.Status== (int)Status.No) .OrderByDescending(_ => _.Agenda.Dt).FirstOrDefault();
29 Mar 2020 by Maciej Los
Seems, you don't understand what OriginalGriff has already told you... So, i'll try to show you an example. Imagine, you have a Person class: public class Person { private string personname = string.Empty; private DateTime dob = new...
29 Mar 2020 by code4Better
Hello All, I have a C# collection; say personal info, List _personalInfo = new List(); Currently I can perform any action on these collection using linq/lamda like _personalInfo.Where or personalInfo.Count or...
28 Mar 2020 by OriginalGriff
The best way to do that is encapsulation: make the List a private member of a class of your own, and create methods to allow users to do "permitted" actions. At no time does the encapsulating class return the encapsulated collection to the...
7 Mar 2020 by James A. Brannan
In this tutorial, you create a simple Python client that sends records to an AWS Kinesis Firehose stream.
2 Mar 2020 by Rion Williams
C# local functions and how they can be used to make code more readable
1 Mar 2020 by JUST_Neeraj
Create long-running, stateful, durable and serverless orchestrations in AWS using the LambdaBiz framework
12 Feb 2020 by OwenDavies
A fix for people experiencing the same issue with AutoMapper 3.2.1
12 Jan 2020 by Maciej Los
I already answered your question here: How to write lambda linq query in C#?[^] Please, respect the rules of QA forum[^] and do not repost questions!
12 Jan 2020 by Member 14169626
var query1=entities.Table1.Where(x=>x.TypeID=="4").Select(x=>x.ID).ToList(); var query2=entities.Table2.Where(x=>x.PID==2)Select(x=>x.ID).ToList(); I'm pulling the same fields from two different tables. The 2nd query retrieves the first query value. What I have tried: var...
11 Jan 2020 by Gerry Schmitz
query2.AddRange( query1 ); List.AddRange(IEnumerable) Method (System.Collections.Generic) | Microsoft Docs[^]
11 Jan 2020 by Member 14169626
Table 1 COLUMN A COLUMN B COLUMN C 123 4 XXX 124 2 XYZ 125 4 LSK 142 4 TSY 156 2 ASA TABLE 2 COLUMNA COLUMNC COLUMNF COLUMNZ 123 XXX 0 QWRT 124 XYZ 0 ...
11 Jan 2020 by Maciej Los
This should've done the trick: var result = table2.Where(second=>second.columnf == 0 && table1.Any(first=>first.columnb == 4 && first.columna == second.columna)) .ToList();
8 Jan 2020 by Maciej Los
Seems you want to create a where statement dynamically. So, please read this: How to use expression trees to build dynamic queries (C#) | Microsoft Docs[^] Here[^], you you'll find quite simple example.
8 Jan 2020 by Member 14169626
Public void List() { string x=""; foreach( var item in t) { x= .... } } I want to write the string values ​​in my hand in lambda. But when I write as where I get an error. What I have tried: var c=MyStudent.tblStudent.Select(x=>x.tblPerson).Distinct().ToList(); I want to where...
8 Jan 2020 by OriginalGriff
Where requires a condition, perhaps something like this: var c=MyStudent.tblStudent.Where(x => x.Contains("John")).Select(x=>x.tblPerson).Distinct().ToList();
2 Jan 2020 by Member 14169626
var q1= Mystudententities.Student.Select(x=>x.ID).ToList(); var q2= Mystudententities.Person.Select(x=>new { ID=x.ID, Name=x.Name }).ToList(); I want to find ids and names that are common to 2 query ids. How do I. Student ID 1 2 3 Person 1 Alex 2 John 4 Mary I...
2 Jan 2020 by Maciej Los
Take a look here: How To Use Join Operations With Database Using LINQ[^]
29 Dec 2019 by Member 14169626
TABLE A: ColumnA , ColumnB , ColumnC , ColumnD TABLE B: ColumnA , ColumnB , ColumnC , ColumnD how do I select two query on the same columns and find partners with intersect? I want to table a => select a,b,c column where d=1 I want to table b => select a,b,c I...
29 Dec 2019 by Aj@yGohil
Try this for select from table var selectedTableAList= (Your DB Context).tableA.Where(x => x.ColumnD == 1).Select(x => new { x.ColumnA, x.ColumnB, x.ColumnC })
17 Dec 2019 by AFell2
Conjecturaly speaking, you will want to make your selections first and then intersect them. So, in SQL, you would do it this way: SELECT A.ColumnA, A.ColumnB, A.ColumnC, A.ColumnD FROM tableA AS A INNER JOIN tableB AS B ON A.ColumnA = B.ColumnA AND A.ColumnB = B.ColumnB ...
17 Dec 2019 by Richard Deeming
The Where condition can only use properties from the projection it operates on. Move the Where before the Select (and fix the other syntax errors) and it will work. var tableA = MyStudentEntities.Where(x => x.ColumnD == 1).Select(x => new { x.ColumnA, x.ColumnB, x.ColumnC });
28 Nov 2019 by AleLo2014
hallo, I am new in mvc and linq. I've 2 table in relation many to many: 1)employe 2)device Selecting an employe I'd like to see his devices: -Marco -Franco Selecting Marco should appear the devices associated to him. In sql I'd like this: select Devices.nome from Devices where Devices.id...
28 Nov 2019 by AleLo2014
Phil found the solution (thank you so mutch!!!): ListDevice = db.Devices.Where(u => u.ImpiegatiDevices.Any(m => m.impiegatiID == id)).ToList();
28 Nov 2019 by phil.o
I'm quite confused since, for a many to many relationship, you need a third table. -- SQL pseudocode TABLE Employee ( EmployeeId int PRIMARY KEY IDENTITY, EmployeeName nvarchar ) TABLE Device ( DevideId int PRIMARY KEY IDENTITY, DeviceName nvarchar ) TABLE EmployeeDevice ( ...
16 Oct 2019 by Member 14624871
An exception of type 'System.ArgumentException' occurred in System.Web.Optimization.dll but was not handled in user code
16 Oct 2019 by Jahan Alem
I've faced a problem that is:An exception of type 'System.ArgumentException' occurred in EntityFramework.dll but was not handled in user codeAdditional information: The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference...
7 Oct 2019 by Member 14169626
I want to sql query convert to lambda expression.How to use lambda expression this query. Class table: Id,Name,Surname School table: Id,Name,SchoolInformation Class Table: 1 Alex John 1 Alex Michael 1 Alex Martin 2 Mary Kelvin School Table: 1 Alex 2 Mary 3 Justin What I have...
7 Oct 2019 by Maciej Los
Sorry, your question is unclear and/or your database is wrongly designed, because schoold.id and class.id can NOT be equal! A database model should looks like: 1 School => ∞ YearBooks 1 YearBook => ∞ Classes 1 Class => ∞ Students So, you need at least 4 objects (tables): 1. Yearbooks table - ...
5 Oct 2019 by Rajat-Indiandotnet
I hope the following way helps you. List _lstStudent = new List(); List _lstSchool = new List(); _lstSchool.Add(new School() { Id = 1, Name = "MVM" }); _lstSchool.Add(new School() { Id = 2, Name = "DPS" }); ...
3 Sep 2019 by Member 14169626
Student table ID 1 2 3 4 ı want to select student where ıd=3. How to where condition lambda expression in c#? What I have tried: Select(t=>Student).where(x=>x.ID==3)
3 Sep 2019 by OriginalGriff
Try: var selected = studentsCollection.Where(s => s.ID == 3); or Student justTheOne = studentsCollection.Where(s => s.ID == 3).FirstOrDefault();
30 Aug 2019 by Member 14169626
I want to use entity lambda query and insert table.But I dont choose same area.How to select and where condition this area. SCHOOL TABLE SCHOOL ID // CLASS ID // CLASS NAME 1 1A 1 1 1B 1 1 1C 1 1 1D ...
29 Aug 2019 by Gerry Schmitz
.Where(s=>s.CLASSID). This where goes nowhere. And not much else.
20 Aug 2019 by StudentSC
I want to select table one column. What I have tried: I error is: return entities.SchoolTable.Select(x=>x.Schoolname); //schoolname string to bool error. And I dont take schoolname this lambda expression.
12 Aug 2019 by Maciej Los
If you want to get single name of school, this statement is incorrect: entities.SchoolTable.Select(x=>x.SchoolName); To be able to get single value, use this: entities.SchoolTable .Where(x=>x.SchoolName=="some school name") .Select(x=>x.SchoolName) .SingleOrDefault();
12 Jul 2019 by Patrick Skelton
This is a follow-on to another question I asked here: https://www.codeproject.com/Answers/5162098/How-do-I-convert-this-LINQ-query-to-function-synta#answer1 I am generating the XML I require using the following code: bool includeDetails = true; XElement breakdown = new XElement ( "Breakdown",...
12 Jul 2019 by Richard Deeming
As discussed in the comments, the code you've shown is correct, and the bug has now disappeared. Demo: Optional Xml | C# Online Compiler | .NET Fiddle[^]
7 May 2019 by BillWoodruff
To me this kind of code ... that will obviously not compile ... indicates you have not really studied the basics of using the powerful tools that Linq provides. Don't worry, though: everyone I know has gone through a learning curve to get somewhat fluent in using Linq :) Well, okay, imho,...
7 May 2019 by Member 14087498
Hi, I just was wondering if I can perform a Query just like that: What I have tried: List = _context.StudentClass .Where(sc => sc.ClassId == 1) .ToList(); List studentIdList = new List(); foreach (var student in...
6 May 2019 by Maciej Los
This piece of code is not clear to me: List studentIdList = new List(); foreach (var student in studentClassList ) { studentIdList = _context.Student.Where(st => st.Id == student.StudentId).ToList(); } If you would like to get list of students in a specific class, you should do...
6 May 2019 by Christian Graus
Just to add, you need to include the Linq namespace for that stuff to start working, otherwise you'll have a List class but not those operators List studentIdList = new List(); Also, this makes no sense. Set it to null if you need to set it inside a scope. Your code sets it over...
6 May 2019 by OriginalGriff
Well, you could ... if you got the names right, C# is case sensitive ... but it wouldn't do much that was useful. The assignment inside the loop means that the eventual result will be the final result only, because it "throws away" all previous results each time round the loop. You might want...
4 Mar 2019 by #realJSOP
I would do it this way: CurrentFinancialMovementData movementData = null; { CurrentFinancialMovementData movement1 = keys.OrderByDescending(s => s.LatestReserveDate) .ThenByDescending(x => x.ReserveDaySequence) ...
1 Mar 2019 by Member 9956700
CurrentFinancialMovementData movementData = keys.OrderByDescending(s => s.LatestReserveDate ?? s.LatestRecoveryReserveDate).ThenByDescending(x => x.ReserveDaySequence).First(); CurrentFinancialMovementData movementDataReserve = keys.Where(s => s.AmountType ==...
15 Dec 2018 by Member 14089908
Hello Everyone, I have a DataTable that contains three columns ID, Shift Start and Shift End ID | Shift Start | Shift End 1 | 4/12/2018 7:00:00 AM | 4/12/2018 11:00:00 PM Now the problem is i want to select all the records within this date and time. I tried the following code but not...
15 Dec 2018 by Patrice T
Quote: the problem is i want to select all the records within this date and time. I tried the following code but not working. You want to know which people were working at a given datetime (dt). It mean people with [Shift Start] before dt and [Shift End] after dt. the problem is than you did...
15 Dec 2018 by pkfox
Nothing to do with your question but never have spaces in column or table names - same goes for file and folder names - just sayin :-)
14 Dec 2018 by kiran0624
string str=4/12/2018 11:00:00 if your searching in sql table select * from table where endshit='4/12/2018 11:00:00';
14 Dec 2018 by RickZeeland
Here is my complete example, tested in VS2017 with .NET 4.5.1: using System; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Linq; using System.Windows.Forms; namespace TestForm1 { /// /// Codeproject DataTable /// ...
14 Dec 2018 by RickZeeland
You can use LINQ like this: IEnumerable selectedRows = dt1.AsEnumerable() .Where(row => (row.Field("Shift Start") ("Shift End"))); foreach (DataRow row in selectedRows) { ...
20 Oct 2018 by OriginalGriff
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which...
20 Oct 2018 by Member 13974276
I have two tables as shown below Table 1 - LR ID___________Name 1 A 2 B 3 C Table 2 - Mapper ID___________LRID 1 1 2 1 3 2 The Mapper table refers LR table. I am trying to get the data from LR table wherever the IDs...
11 Jul 2018 by sri4dotnet
Hi, I am trying to do join, group by and where condition using lambda expression in entity frame core but unable to return the query as IQuerayable. Below is the code - _entities.Company.Join(_entities.Employee, com => com.Company_id, ...
11 Jul 2018 by F-ES Sitecore
If you want it IQueryable then don't do the "ToListAsync" at the end.
18 May 2018 by #realJSOP
The structure of your objects (Car and CarOwner) prevents you from getting what you want (without additional coding). First, you shouldn't try to do everything in one line of code. IT's not that it's not possible, it's that it's bad practice because it is HIGHLY unmaintainable. Add this class:...
16 May 2018 by Clifford Nelson
var results = owners.Where(b => b.Cars != null) .GroupBy(o => o.Gender, o => o.Cars, (key, g) => new Result { Gender = key, Name = g.SelectMany(cars => cars) .Select(car => car.Name).Distinct().OrderBy(k => k).ToList() }); I forgot the...
16 May 2018 by sam_roy
public class Car { [JsonProperty("name")] public string Name{get;set;} [JsonProperty("type")] public string Type{get;set;} } public class CarOwner { [JsonProperty("name")] public string Name{get;set;} [JsonProperty("gender")]...
8 May 2018 by JIANGWilliam
This is the first of three episodes to introduce considerations and techniques used for the throwable functional interfaces defined in my open-sourced library functionExtensions.
23 Mar 2018 by OriginalGriff
Quote: EDIT: Oooooh. It's the signature... Sorry for the stupid question........ It is indeed! For the benefit of others with a similar problem, the sh2 declaration requires a parameter: ReturnAStringHandler sh = ReturnAString; ReturnAStringHandler sh2 = (x) => sh(x); ...
23 Mar 2018 by The_Unknown_Member
What's the problem with the following code? class Program { public delegate string ReturnAStringHandler(string s); static void Main(string[] args) { ReturnAStringHandler sh = ReturnAString; ReturnAStringHandler sh2 = () => sh("Hello"); ...
21 Mar 2018 by Member 13740593
I am trying to find the best way to optimise the converters below to follow the flow I call 'convertAndGroupForUpdate' first which triggers the conversions and relevant mappings. Any help to optimise this code would be massively appreciated. public List...
19 Feb 2018 by Richard MacCutchan
python aws lambda - Google Search[^]
14 Jan 2018 by maheshbisht
I have a list of class public class PrintUTAccural { public string PropertyName { get; set; } public string VendorName { get; set; } public string VendorNumber { get; set; } public string InvoiceNumber { get; set; } public...
10 Jan 2018 by Member 11596389
Hi want to return a list of areas which dont appear in the current list of data; I have two list of data, once which contains a list of areas; A second one which contains the data i want to query the data list and return only where area does not exist in the list What I have tried: This...
10 Jan 2018 by KHEMRAJ_UDR
try this may be help you.. c# - compare two list and return not matching items using linq - Stack Overflow[^]
9 Jan 2018 by Maciej Los
Dependig on situation you may use: Except(TSource)[^] or Intersect(TSource) Method [^] or Any(TSource) Method[^]
9 Jan 2018 by Dotnet_Dotnet
Sir the Demo code given bellow .For the match element Contains but for negative ! operator is used var exceptionList = new List { "exception1", "exception2" }; var query = myEntities.MyEntity .Select(e => e.Name) .Where(e =>...
2 Dec 2017 by Duncan Edwards Jones
I have a piece of code that is supposed to use Linq Expressions to put together a "compiled at run time" lambda function to persist events to a stream. (This is to allow the function to be swapped out by injection if you want to use a different serialisation technology) The code is:- Public...