[QUESTION] SqlExpressions, how to pass many parameters and if possible to pass linq properties
See original GitHub issueDescribe your issue
Is possible to pass many parameters in a SqlExpression?
[Sql.Extension("ROW_NUMBER() OVER(PARTITION BY {args, ', '} ORDER BY {0}", ServerSideOnly = true)]
public static int GetRowNumber(string orderBy, [ExprParameter] params object[] args)
{
throw new NotSupportedException();
}
I’m trying to accomplish a way to make reusable a sql expression to retrieve a row number based on some columns and pass a column as ordering criteria, any idea about how to accomplish this? Final generated query should be something like:
ROW_NUMBER() OVER(PARTITION BY foo1.name, foo1.age, foo1.birthdate
ORDER BY foo1.age)
Environment details
Linq To DB
version: Last stable version
Database (with version): Oracle
Issue Analytics
- State:
- Created 5 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Multiple search parameters with LINQ
I'm trying to figure out the most efficient way to search for multiple (arbitrary number of) search parameters with it. In the windows...
Read more >How to reference an Objects property name as a parameter ...
This way I can run the method for each property I want to search for by passing in a string that replaces PropertyAsParameter...
Read more >Lambda expressions and anonymous functions
Run(Action) method to pass the code that should be executed in the background. You can also use lambda expressions when you write LINQ...
Read more >LINQ to SQL (Part 8 - Executing Custom SQL Expressions)
You can do this either by passing a type-object as a parameter to the method, or by using a generic-based version of the...
Read more >7 tricks to simplify your programs with LINQ - Igor Ostrovsky
1. Initialize an array · 2. Iterate over multiple arrays in a single loop · 3. Generate a random sequence · 4. Generate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That worked! you are like Rihanna, you shine bright like a diamond lol thanks! ❤️ @sdanyliv
Can you try this one?