mejobloggs
mejobloggs
CC#
Created by mejobloggs on 11/23/2023 in #help
EF/Linq select all columns of main table, but only some cols of joined table?
yeah doesnt seem possible
56 replies
CC#
Created by mejobloggs on 11/23/2023 in #help
EF/Linq select all columns of main table, but only some cols of joined table?
Collection navigation access can be filtered by composing Where, OrderBy(Descending), ThenBy(Descending), Skip or Take operations.
56 replies
CC#
Created by mejobloggs on 11/23/2023 in #help
EF/Linq select all columns of main table, but only some cols of joined table?
ooh hang on, i think i see what im doing wrong let me try again
56 replies
CC#
Created by mejobloggs on 11/23/2023 in #help
EF/Linq select all columns of main table, but only some cols of joined table?
You can filter rows inside an Include, but not columns
56 replies
CC#
Created by mejobloggs on 11/23/2023 in #help
EF/Linq select all columns of main table, but only some cols of joined table?
I gave it a try and you can't seem to do anything like that. I can only find how to do it by explicitly stating each individual column I want from ThingOne
56 replies
CC#
Created by mejobloggs on 11/23/2023 in #help
EF/Linq select all columns of main table, but only some cols of joined table?
.Include will get all, but it won't help the query only get A2 for ThingTwo
56 replies
CC#
Created by mejobloggs on 9/1/2023 in #help
✅ Easier way to "mark" a class as a different "type" without having to create a new class?
Enums it is then, thanks guys
7 replies
CC#
Created by mejobloggs on 5/24/2023 in #help
❔ Is it a problem to be creating lots of empty lists etc just to avoid null checks?
It sounds like Enumerable.Empty<T>() or Array.Empty<T>() might be a better way, reading through here it sounds a more efficient equivilent https://stackoverflow.com/questions/8555865/is-there-an-empty-list-singleton-in-c
11 replies
CC#
Created by mejobloggs on 5/24/2023 in #help
❔ Is it a problem to be creating lots of empty lists etc just to avoid null checks?
if there was no data available yes just creating empty lists. i guess garbage collector discards them later
11 replies
CC#
Created by mejobloggs on 5/24/2023 in #help
❔ Is it a problem to be creating lots of empty lists etc just to avoid null checks?
performance isnt particularly critical i just felt like i was doing something wrong generating thousands of empty lists just to save me from null checking and wondered if there was a better way
11 replies
CC#
Created by mejobloggs on 5/24/2023 in #help
❔ Is it a problem to be creating lots of empty lists etc just to avoid null checks?
just checked whats happening in the actual program yes it could be readonly, but the data comes from database and sometimes data may not be available for each list etc so they legitimately could be null
11 replies