Have Question about the Linq and 1 line assign

Hi.
i learn about UiPath(.net) and C#

In C#,
the Linq have ‘from , where , orderby and select’

In UiPath,
Object in for each is set the variable.IEnumerble().where(Function(x) x…

what is different?

@kuku_uu

  • LINQ is a language integrated query (LINQ) that is used in C# and other .NET languages. It provides a way to query data in a declarative way, using expressions that are similar to SQL.

In UiPath, you use the For Each activity to iterate through the collection, and you apply filtering using the Enumerable.Where method within the For Each activity. The Where method takes a lambda function as an argument, which represents the condition for filtering. The items that satisfy the condition are processed within the For Each loop.
The main difference between LINQ and UiPath for each is that LINQ is a more powerful and flexible way to query data. It allows you to perform complex queries on data from different sources, and it can be used to generate SQL queries. UiPath for each is a simpler way to iterate through a collection of objects, but it is not as powerful as LINQ.

@kuku_uu

  1. For each in UiPath does not use linq…

Linq is something you can use in UiPath also…for each is same as your for each in c#

Cheers

Hi,

There are 2 types LINQ expression

  • Method base expression
  • Query expression

In C#,
from , where , orderby and select’ is Query expression
strArray.Select( s=> s.length).ToArray() is Method base expression, for example.

And In UiPath

variable.IEnumerble().where(Function(x) x… is Method base expression for VB.net
And also, we can use Query expression for each language.(C, VB.net) in UiPath.

The following LINQ document might also help you.

Regards,

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.