PixxelKick
✅ object composition: a database perspective
It's pretty rare to truly need a genuinely infinitely recursive tree structure.
Most applications from clients won't be mad if you impose a reasonable max depth restriction as a tradeoff for it being waaaaay easier to implement
16 replies
✅ object composition: a database perspective
I have a rule for when to use database solutions, soecufucally, Views and Stored procs.
When I need to force a sub query for entity framework, I use a ViewTable (so I can keep using EF core on the "outer query")
Whenever recursion is involved, I use a Stored Proc.
There's no easy way to do recursion any other way for a db query, tbh
16 replies
Optimization problem for matching two lists of objects with same property
It looks like you have a 1:1 relationship between trader and user which is a DB smell, you shouldn't have 1:1 relationships in a database (1:1 relationship means they should just be the same table)
10 replies
learning moq framework
@uffen My recomendation is not used a mock library at all. Avoid mocking stuff entirely except for "on the edge" stuff.
Most of which have built in easy ways to mock their data, IE HttpClient has a built in way to mock its response very easily, no library needed.
Write code that doesn't need mocking. Once you get into that habit you'll find your tests become substantially easier to write too
13 replies