Utsuhoagie
Explore posts from serversEF Core with TPC hierarchy: InvalidCastException despite no casting
But still, I want to figure out what causes the issue, I really don't understand why it's trying to cast objects that aren't related, and I'm not casting anything
My best guess is that many entities have the same int IDs because they used to be separate and EF Core itself is trying to cast them randomly to other types
12 replies
EF Core with TPC hierarchy: InvalidCastException despite no casting
I could simply not use any inheritance and just manually have nullable navigations for each entity type instead (there's just gonna be like 8 max anyway), but I wanted to try doing something I've never done before
12 replies
EF Core with TPC hierarchy: InvalidCastException despite no casting
I mean, that's exactly what I did before. When I started working on this feature, I realized
TierListItem
could be related to basically any other entity in the app, and so I made all of them inherit from BaseEntity
(or audited)12 replies
EF Core with TPC hierarchy: InvalidCastException despite no casting
What I planned is to allow the user to navigate to the "source" of a
TierListItem
by clicking on it, which would require the type + PK (in this case just an ID)
Also, I currently have 1 but potentially a few more methods on BaseEntity
which returns a formatted label string depending on the derived class, so I'm thinking to keep this hierarchy12 replies
EF Core with TPC hierarchy: InvalidCastException despite no casting
TierListItem
is simply any kind of item that can be made into tier lists. For example you could make tier lists for songs, circles (music groups), remixes, games, characters,...
So I wanted TierListItem
to have a relation to a BaseAuditedEntity
, because most entities can be a tier list item12 replies
Non-return part of <For>'s callback only seems to run once?
Does this apply to every place where I'd like to access reactive state? I initially thought it should be fine as long as it's not in a top-level body of the component itself. Here it's still technically inside the return of my page component
11 replies
Non-return part of <For>'s callback only seems to run once?
(too long so I gotta post externally)
https://pastes.io/7nmrbrpcql
11 replies
How to implement JWT authentication in SolidJS, without SolidStart?
I did suspect that reactivity was a problem because I wasn't using any signals, but I wasn't sure if the browser cookie API would work out of the box somehow, there's not much to read about it.
Thanks though, I'm experimenting with this package and it seems to work! I don't even need to manually
navigate()
after say, logging in. Though right now I'm using sessionStorage instead, but it should be fine for my app as there's no real risk (or users)9 replies
✅ Nullable DateTimeOffset field in a [FromForm] model is always null
This is on React Native on a physical phone though (specifically it's an Expo app, running on Expo Go on an Android). The only "devtools" I have are in the screenshot which is pretty primitive (there used to be a debugger app for older versions but I can't get it to run on my current version)
18 replies
✅ Nullable DateTimeOffset field in a [FromForm] model is always null
SOLVED (Kind of)
I was dumb, and maybe the Network inspector lied to me.
What I was trying to
append()
to was actually a Date
object, not an ISO timestamp string. I just used the wrong explicit type in TypeScript (fix BirthDate?: string
to BirthDate?: Date
, because a date picker component was changing BirthDate
into a Date
), so it was trying to append a Date
instead, and while the Network inspector still shows an ISO string (like the screenshot above), my server can't bind the property at all.
Fixing the types worked, even though the Network inspector still shows the same data being sent.18 replies