Closed TheTedder closed 1 month ago
~Kinda don't like having inheritance on the interfaces themselves. If we do go down with the interfaces approach; I'd rather we do something like this:~ (actually it really doesn't matter. Though I would still prefer if we did the base class, though)
public class Leaderboard : ICreatedAt, IUpdatedAt
Alternatively as I've said in the channel; we just do a base class with all three timestamps, and have classes inherit that
~Kinda don't like having inheritance on the interfaces themselves. If we do go down with the interfaces approach; I'd rather we do something like this:~ (actually it really doesn't matter. Though I would still prefer if we did the base class, though)
public class Leaderboard : ICreatedAt, IUpdatedAt
Alternatively as I've said in the channel; we just do a base class with all three timestamps, and have classes inherit that
Having one base class with all three is impossible since some tables have CreatedAt but not UpdatedAt. I couldn't see an easy way to automate DeletedAt so I'm keeping that one manual for now. Would you still like to me get rid of the inheritance?
Yeah nah just keep what you have. Don't have to that class inheritance thing.
How'd you figure out on how to add methods in ApplicationContext like that?
How'd you figure out on how to add methods in ApplicationContext like that?
I'm actually a wizard IRL. Also I read this article.
Would IHasUpdateTimestamp
trigger on creation as well?
Would
IHasUpdateTimestamp
trigger on creation as well?
I'm not sure but it doesn't really matter either way as far as I'm concerned.
What it says on the tin. Had to mess with the tests a bit to get this working properly. Also removes erroneously overridden
Equals
andGetHashCode
on models (this is a no-no). Closes #237