Cisien
Cisien
CC#
Created by Joo on 11/16/2023 in #help
Hello World taking 30 seconds + to run
40 replies
CC#
Created by Joo on 11/16/2023 in #help
Hello World taking 30 seconds + to run
yes
40 replies
CC#
Created by M B V R K on 12/30/2022 in #help
✅ Adding EF Core Migration Error
Yep
7 replies
CC#
Created by M B V R K on 12/30/2022 in #help
✅ Adding EF Core Migration Error
You may need to play around with the project and startup ptoject command line switches
7 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
but if you can do it in a single query with joins (.Include/navigation properties) it will likely be easier/better
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
of course the specifics aren't exactly what i posted, you'll probably have to tweak them
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
something like that should let you skip the intermediary step of collecting ids and then doing another query
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
yeah
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
var posts = await _db.SavedPosts.Where(a => a.account.username == targetUsername) .OrderByDescending(a => a.saveDate) .Select(x => x.Post) .ToListAsync();
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
that's probably the best way to get at the posts
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
do you have a navigation property between posts and saved posts?
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
another option is to include the date in your select
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
why not sort by p.id?
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
well, in reality it's generating sql that look similar to SELECT * From Posts WHERE id IN (1,2,3,4,5 /*whatever saved posts ids contains*/)
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
Where is a filter, it expects an expression that returns true if it should include the item, or false if not. So what this is doing is checking to see if the post's id is contained in the savedpostIds list, if it is, include it
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
other way around
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
Contains will do the same thing as indexof != -1 (sorry, typo in the first suggestion)
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
you only need one
38 replies
CC#
Created by İrşat on 12/25/2022 in #help
✅ Ordering IQueryable by the indexes of another list
one or the other
38 replies