becquerel
✅ Beginner Projects
best way to learn is by doing challenging things, so definitely jump in if you're interested. as leowest said you will need to learn the OOP way of doing things to structure a GUI well. you will very likely also need some understanding of async/await and delegates/action<T>/func<T>.
17 replies
.Net framework async controllers
also, not a concern, just a bonus to keep in mind - as you use more async apis you will also have the opportunity to pass down CancellationTokens a lot more, so it can be worth passing those down the chain to your database layer preemptively, even if you don't use the async db calls just yet
9 replies
.Net framework async controllers
no dangers but there are dangers inherent to async; consider an analyzer like this to flag them up https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
9 replies
Worker service recommended folder structure / namespaces
i would say the biggest things are
- for unit tests, avoid non-determinism. if you use randomness, make it so you can seed it. don't use DateTime.Now - inject an ISystemClock instead. I/O is inherently non-deterministic, so either avoid doing I/O in your business code (best option) or mock it out (easier)
- for integration tests, look into Testcontainers. it's far easier to just spin up a real database in a container than to try to make a fake database or mock it out
- get your tests running in a continuous integration pipeline as a priority. otherwise you will forget to run them
- generally, prefer to use dependency injection for your classes. it makes life a lot, lot easier. by that token, avoid using static methods or extension methods which do complex things, as you can't mock them out
18 replies