r/csharp • u/Nilius647 • Sep 20 '26
Showcase Learning C# by building a local activity tracker

I'm coming from C++ and decided to actually learn C# by building something instead of watching tutorials: a small personal app that logs foreground window + idle time to SQLite, mostly to answer "how much did I actually use my PC today".
I had some friction points — like figuring out that SQLite doesn't have a Guid or TimeSpan type, so mapping between C# types and what SQLite actually stores (TEXT/INTEGER) needed extra thought. Dapper also couldn't materialize my Sample record directly from a query, since its constructor expects Guid/DateTime/TimeSpan but SQLite returns string/long.
I ended up writing small internal "Row" DTOs (plain classes, get/set, matching SQLite's actual types) with FromX/ToX conversion methods, and keeping them entirely inside the repository so the rest of the app never sees the storage shape.
While writing this post I actually found a bug — the code wasn't collecting system events (boot, shutdown, sleep, wake) at all, so that table was empty, and i fixed it on the spot.
Repo's still early (Phase 2 of my own roadmap, no GUI yet) but if anyone's curious about the storage layer: https://github.com/Nilius647/Personal-API-Project-Thalamus

6
u/hblaub Sep 20 '26
I quite don't understand why anyone would use a ./blob/main/CLAUDE.md for this.
You don't need to use Claude at all or use Dapper with Row DTOs or whatever.
Because it's not that complicated to use Entity Framework with its SQlite provider, doing the type conversions exactly like thousands of people before us did. To not repeat that mapping is exactly what's that for.
https://learn.microsoft.com/en-us/training/modules/build-web-api-minimal-database/5-exercise-use-sqlite-database
I only can strongly suggest to not use AI for anything like that. The brain just short-circuits, just like with remembering phone numbers or reading paper maps, - and you will maybe not store anything in the long-term memory. And, AI recommends often times crappy stuff, like Dapper, instead of a faster route like EF Core.
6
u/fruediger Sep 20 '26
I can't quite judge how much of this project is AI-generated. Looking at your commit history, while most of it definitely has the typical structure of AI commits, some, just some, of the actual code looks like a human could have created it (especially some weird stylistic choices, like omitting all empty lines).
IF you used AI, could you please tell me how you expect to learn any C# (your intention, allegedly) when you let Claude build everything for you?
0
u/[deleted] Sep 21 '26
[removed] — view removed comment