Utsuhoagie
Utsuhoagie
Explore posts from servers
CC#
Created by Utsuhoagie on 8/10/2024 in #help
EF 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
CC#
Created by Utsuhoagie on 8/10/2024 in #help
EF Core with TPC hierarchy: InvalidCastException despite no casting
Perhaps you're right. It's really just a small project I'm practicing, nothing serious. At most I would expect about 8 different entity types, but currently it's just about 4
12 replies
CC#
Created by Utsuhoagie on 8/10/2024 in #help
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
CC#
Created by Utsuhoagie on 8/10/2024 in #help
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
CC#
Created by Utsuhoagie on 8/10/2024 in #help
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 hierarchy
12 replies
CC#
Created by Utsuhoagie on 8/10/2024 in #help
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 item
12 replies
SSolidJS
Created by Utsuhoagie on 11/26/2023 in #support
Non-return part of <For>'s callback only seems to run once?
Thanks to you both btw!
11 replies
SSolidJS
Created by Utsuhoagie on 11/26/2023 in #support
Non-return part of <For>'s callback only seems to run once?
I'm liking it so far because there's just entire groups of bugs I don't see anymore, but at the same time I'll have to unlearn some of my habits back in React
11 replies
SSolidJS
Created by Utsuhoagie on 11/26/2023 in #support
Non-return part of <For>'s callback only seems to run once?
Yeah I guess I'll need to experiment with Solid more to get used to it
11 replies
SSolidJS
Created by Utsuhoagie on 11/26/2023 in #support
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
SSolidJS
Created by Utsuhoagie on 11/26/2023 in #support
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
SSolidJS
Created by Utsuhoagie on 11/18/2023 in #support
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
SSolidJS
Created by Utsuhoagie on 11/18/2023 in #support
How to implement JWT authentication in SolidJS, without SolidStart?
Is this even close to a good approach? How should I implement this?
9 replies
CC#
Created by Utsuhoagie on 4/27/2023 in #help
✅ 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
CC#
Created by Utsuhoagie on 4/27/2023 in #help
✅ 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
CC#
Created by Utsuhoagie on 4/27/2023 in #help
✅ Nullable DateTimeOffset field in a [FromForm] model is always null
18 replies
CC#
Created by Utsuhoagie on 4/27/2023 in #help
✅ Nullable DateTimeOffset field in a [FromForm] model is always null
How do I check that? Closest I could try is this Network inspector in Expo Go:
18 replies
CC#
Created by Utsuhoagie on 4/27/2023 in #help
✅ Nullable DateTimeOffset field in a [FromForm] model is always null
It looks pretty normal to me, I tried checking the Network inspector in Expo Go and it does contain an actual timestamp for BirthDate
18 replies