question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IQueryable , select in select

See original GitHub issue

hi when i use IQueryable

now i want

CommentSelectPendding().Where(r => (r.UserKind == 4)).tolist();;

T Sql has select to select ,

select  *from (
select* from tbl where ....

    orderby  r.CommentId
)

where UserKind = 4

   private IQueryable<tblComment> CommentSelectPendding()
        {
            return (from r in new db.GetTable<tblComment>()
                     where r.AcceptStatus.Equals((byte)Enums.CommnetAcceptStatus.Pendding) && r.InsertDate < DateTime.Now.AddSeconds(-35)
                     orderby  r.CommentId
                     select  r);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sdanylivcommented, Feb 29, 2020

And simple suggestion, do not use current DateTime, but Sql.CurrentTimestamp.AddSeconds(-35) In this case you do not have to worry about client-server time resynchronization.

1reaction
sdanylivcommented, Feb 29, 2020

Please post real linq2db queries, not samples. And remove NEW keyword from place that i have mentioned before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Queryable.Select Method (System.Linq)
The query behavior that occurs as a result of executing an expression tree that represents calling Select<TSource,TResult>(IQueryable<TSource>, Expression<Func< ...
Read more >
IQueryable C# Select
If you only want a limited number of columns and you intend to pass the result out of the method, first declare a...
Read more >
Use Caution When Using Select with IEnumerable or IQueryable
In the code, I used a Select to transform a model class into another class. ... Linq/System/Linq/Select.cs private sealed partial class ...
Read more >
C# (CSharp) IQueryable.Select Examples
Select - 60 examples found. These are the top rated real world C# (CSharp) examples of IQueryable.Select extracted from open source projects. You...
Read more >
8 Tips and Tricks for Writing the Best Queries in LINQ to ...
8 Tips and Tricks for Writing the Best Queries in LINQ to Entities · Pull only the needed columns · Use of IQueryable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found