TravestyOfCode
❔ EFCore One-To-One
Also could have a table with BusinessId, Day, From, and To columns? Then you can have a relation of one business to many WorkingHours. Would also support having multiple working periods for a business. Say, Monday 9 to 11:30 and 12:30 to 5.
7 replies
✅ What is the best way to fix StackOverflow when methods are calling each other?
Unless you need to know all possible moves that would result in a Check situation, but it looks like your just doing true/false. Other optimizations could include ignoring a piece's if it's range is outside of king pos. For example, if a pawn is at A2, and King is at G5, there's no need to check that piece for Check as it's impossible.
20 replies
✅ What is the best way to fix StackOverflow when methods are calling each other?
It would probably be faster to check each piece by piece instead of getting all valid moves first. Once you find one move that results in a Check (or Checkmate) you don't have to search the other possible moves.
20 replies
❔ efcore querying
In
ToContract
you would need to check for a null ProductRating
as part of the product
. If you have a int?
called UserRating
you would add if (product.ProductRating != null) UserRating = product.ProductRating.Rating;
to your ToContract
44 replies