becquerel
becquerel
CC#
Created by Steivsh on 4/5/2025 in #help
✅ Beginner Projects
personally i like blazor a lot
17 replies
CC#
Created by Steivsh on 4/5/2025 in #help
✅ Beginner Projects
winforms tends to be the easiest way to start making UIs for beginners, but for more serious projects you will want to look into either WPF or avalonia (for desktop apps), or asp.net core mvc/blazor (for web apps)
17 replies
CC#
Created by Steivsh on 4/5/2025 in #help
✅ 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
CC#
Created by Malo on 3/30/2025 in #help
Can't access a function inside a class library
It might also be useful to show the .csproj for your other project so we can see how you set up the reference
11 replies
CC#
Created by Malo on 3/30/2025 in #help
Can't access a function inside a class library
Please show an example of how you are calling it.
11 replies
CC#
Created by Malo on 3/30/2025 in #help
Can't access a function inside a class library
How are you trying to call CreateResponse, and what error are you getting?
11 replies
CC#
Created by Gustav on 3/17/2025 in #help
.Net framework async controllers
your controllers can have cancellationtokens at the top level for when users kill their requests early
9 replies
CC#
Created by Gustav on 3/17/2025 in #help
.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
CC#
Created by Gustav on 3/17/2025 in #help
.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
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
i've seen tests which make assertions based on the log messages a class made - extremely useless and annoying lol
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
also, tests should measure the visible output of a system. they shouldn't try to peer inside a system to examine its internals
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
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
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
very big topic
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
good resources on how to write testable code in C#?
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
e.g. if you need to change your newsletter email feature, you don't want to have to search around five different 'layers' to find all the relevant code
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
the motivation for this is that code usually changes based on feature, and code that changes together should live together
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
organising things based by if it's a filewriter or about the database goes against this
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
i.e. 'all the code for signing up new users goes into this folder', 'all the code for sending newsletter emails out goes into this folder'
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
organise your code based on the categorisations real humans would care about, not programmers
18 replies
CC#
Created by jojomueller05 on 1/8/2025 in #help
Worker service recommended folder structure / namespaces
structured by Entity (e.g. FileWriter/, Customer/, DB/, ...),
no, structured by feature - that's an important distinction
18 replies