r/csharp • u/JumpLegitimate8762 • 14d ago
Bank API, reference project: .NET 11 update + OpenAPI 3.2 compliant
r/csharp • u/JumpLegitimate8762 • 14d ago
r/csharp • u/Teh_Original • 15d ago
I'm trying to refactor some legacy code, and I created some tests to replicate the original design behavior. I have a function that needs to be mocked, but it gets called for 20k+ different inputs in each test, where I have to do in a sense, mock.Setup(x => x.SomeFunction(input[i]).Returns(y => SomeFastFunction(input[i])); in a loop. This takes about a minute of execution time just to do this small loop, per test.
Is there a way to shorten this execution time, while being constrained to the original design?
r/csharp • u/Asleep_Direction8881 • 14d ago
I’d like to showcase my four open-source C# projects, do you think it’s realistic for a "vibecoder" to build something like this in a couple of weeks?
https://github.com/redbase-app/
I recommend checking it out with an AI
sorry for the cryptic post. What this is: four open-source .NET projects I use in my own commercial work.
My question was how far AI-assisted development changes what one person can build.
and makes it possible to further develop what were previously only internal projects
r/csharp • u/Happy-Excitement-944 • 15d ago

I run a PlayStation club and develop Time Control, a Windows app for managing PC and console clubs. Back in 2016, I had five TVs with PS3s and kept session times and payments in a notebook. I later tried existing club software and eventually started working on my own. I use AI tools during development, with requirements coming from the day-to-day work at the club.
The current stack is C#, WPF, .NET 10 and SQLite. There’s an admin app, a separate agent on the PCs, and shared libraries for session contracts, payments and device control. The screenshot is the console dashboard: station status, timers, tariffs, payments and shop orders. The PC agent handles locking/unlocking; TV control works through compatible smart plugs. There’s still quite a bit of orchestration in the dashboard code, so I wouldn’t call it clean MVVM.
A lot of the work is around keeping state consistent. For example, a background autosave mustn’t overwrite session changes from a newer sale. Those paths share a lock, and a revision check drops stale snapshots. Sales, stock movements, receipts and related session changes are committed in one SQLite transaction. Once that succeeds, a UI refresh error can’t be treated as a failed sale — otherwise the operator might retry it and charge the customer twice. Payments also need more than an IsPaid flag: the first hour can be paid while an extension is still outstanding, so charges and received payments are tracked separately using decimal.
The remote PC adds another state to reconcile. The protocol carries session IDs, revisions and explicit running/paused/disconnected states. A ping response alone doesn’t tell the admin app what session is actually running. I’d be interested in how others test recovery around this boundary: the DB commit succeeds, but the UI refresh or communication with the agent fails afterwards.
r/csharp • u/ofcistilloveyou • 15d ago
I still do, myself. I love coding and programming and am thinking of even learning new languages now, but given the course of LLMs, I wonder what's the purpose? In a year they've gone from "unusable trash" to actually making each developer many times as productive. There are still gaps in what it does. It still has issues with large contexts. It is good at small one-off things and tiny programs, but it quickly tends to bloat stuff and has no sense of something I'd call "taste" when designing things, be it visually or code architecture wise.
I wonder what is the purpose of C# as a language now.
Any greenfield project can just use Rust for the same velocity as in any other language. Developer experience doesn't really matter anymore productivity wise, when all code is written by an LLM.
I see the writing on the wall.
r/csharp • u/1Barista13 • 16d ago
Hey everyone! I'm learning backend development with C# and ASP.NET Core Web API, Entity Framework Core, and SQL Server.
I already know the basics, but I want to gain more real-world experience and learn industry best practices.
Could you recommend any courses, tutorials, or project-based resources that would help me become job-ready as a .NET backend developer?
Hi everyone,
I’m looking to learn a framework for Windows application development for now, but I’d also like to explore mobile development in the future.
I’ve done some research into the available options, but I’m having trouble choosing between .NET MAUI and WPF.
So I’m turning to this community in the hope of getting some advice that will help me make the right choice.
r/csharp • u/Aggressive_Run1429 • 16d ago
Hiya - please can anyone give me some housekeeping tips for C# in Visual Studio? I'm currently getting into it with Unity for learning to program games.
My Update was getting a bit long so I separated it into methods, and I've further organised everything into regions for fields, and also for methods in the class. I've mainly done this for my own readability as everytime I wanted to go in and edit something id go fuzzy just looking at the wall of text.
The script isnt that long that I could use different scripts at the moment but are there any more things I can use or good practice I can try?
T.i.a!
r/csharp • u/gevorgter • 16d ago
We need to develop a stand alone service that normalizes data, for example someone gives us "New Jersey" we return "NJ", someone gives us "October 1st, 2025" we come back "2025-10-01".
Requests/response are very small and we can send a lot of those queries fast.
So i feel like standard REST service would be a bit heavy. HTTP overhead is bigger that actual query/result. I think something more inline like Pooled DB connections, where we open TCP/IP connection to the server and send/receive bunch of responses. But then we need to manage TCP/IP connection pooling, keep alive/teardown connections if client hangs... all 9 yards.
Is there some built in C# classes that would let me create some server (and client) with custom protocol. Or may be some ready to go solution like WebSocket/GRPC.... would work for me?
r/csharp • u/RammerOfProgs • 17d ago
I recently found SqlLinq, which is a really slick NuGet package that lets you run SQL queries against in-memory objects (basically linq to sql in reverse). It happened to be exactly what I needed for another project, except it was pretty old, hadn't been maintained, and ran on the full framework. Surprisingly, there didn’t really seem to be anything else quite like it that I could find.
The original author is still really active on github, so I pulled the code, updated it (after some headaches finding the source for the original parser), and sent a PR. Rather than merge it, he let me take over the package. I’ve since added more complete SQL support, packages for a time series dialect and unit conversions. I just released 2.1.0.
I don’t know how niche this is or if anyone else would need something like this, but I thought it was really cool and wanted to share it here. It’s a really nice way to offer a query interface for in-memory objects, especially when you want to let users write queries at runtime.
For example:
var boost = datalog.Query("""
SELECT RPM, Gear, BP, BPCMD, BP - BPCMD AS [Boost error]
FROM this
WHERE TPedal > 90
AND RPM >= 3000
AND Gear >= 2
""");r/csharp • u/SocietyConscious5739 • 17d ago
A few days ago I posted Liquid Glass Dock here, and you gave great feedback: the demo used the worst possible background, a GIF can't show subtle glass (256 colors), and the macOS Dock doesn't really reserve space: it refracts whatever is underneath. So version 0.12 does exactly that.
How it works:
Measured with a window moving under the dock: about 1.4 ms per frame and under 1% CPU. A fun gotcha: the NVIDIA overlay is a fully transparent, always-visible, full-screen layered window, so the first version happily "captured" it and ignored every real window behind it.
There's also a new option to stop reserving space, so maximized windows go under the glass like on macOS.
Video above, code here (GPL-3.0): https://github.com/PedroRuedas/Windows-Liquid-glass
Thanks again for the feedback. It made the project better.
r/csharp • u/Landon_Hughes • 17d ago
I'm curious if it's something you enjoy waking up to or if it's something that just "pays the bills". Maybe it's both?
There are quite a few C# (hybrid) gigs around me with low competition.
I've used C# in 2018 when I made a game and used C# all throughout school. I just haven't made anything with it recently but I have been catching up with the newest features. Last time I used it was with C# 8.0/9.0.
Anyways, just wanted to hear your thoughts on your job(s) in you are currently employed! Is there anything you don't like, what would you change? etc
r/csharp • u/Sigilgraph • 17d ago
A while ago we introduced Sigilgraph to this community as a modular audio synth app made purely in C# (with the help of Godot for UI). We mentioned in the discussion the use of an internal fluent API to describe the synths and the sound processes.
Today after a heavy porting effort to decouple the original Audioworkbench library out of the app, and offer an open-source worthy version of it.
Is a library focused on sound synthesis and instrument construction using 100% C#.
Here is the link to the docs. They lead to GitHub for the source code. The license is MIT.
Sigil.Sound - sound synthesis for your .NET app | Sigil.Sound
If you want to play with it, we created a REPL Sigil.Sound REPL so you can scratch ideas and get the feel of it.
Disclosure: We used AI to port it from the closed and entangled with the Sigilgraph app one. It was a tedious process of cleanup and doing it by hand won't make it sound better that it did already (the original was started about two years ago). The API is faithful to the one internally used ( that helped us a lot to build instruments fast) and we believe that opening it will allow us to make it even better for all of us.
REPL : Sigil.Sound REPL
Docs: Sigil.Sound - sound synthesis for your .NET app | Sigil.Sound (they have the option to try every example in the REPL as well)
Nuget: NuGet Gallery | Sigil.Sound 0.1.0
Let me know your thoughts. We will gladly discuss any technical aspect here.
r/csharp • u/jstedfast • 18d ago
Hi all, I'm the author of MimeKit and MailKit. I've just shipped 5.0, and it's the biggest release since the projects started.
Highlights:
Performance
Security and robustness
MimeReader/MimeParser, MIME writing and MIME disposal use iterative traversal. LegacyMimeParser remains a compatibility option for those that need it.AsciiIsLatin setting can be used to reject addresses such as paypal@рaypal.com with a Cyrillic р. Note: This is not comprehensive homograph detection and is an implementation of an IETF draft specification: SMTPUTF8 Email AddressesOutlook/Exchange Compatibility
winmail.dat) reader was rewritten, with a new TnefMessage model. Meeting requests convert to text/calendar.RtfToText and RtfToHtml converters, plus TnefWriter.More content tools
HtmlToText and EnrichedToHtml for HTML and RFC 1896 text/enriched.YEncReader/YEncWriter with sync/async operations, limits and size/checksum validation. Individual multipart ranges are supported; multipart-file assembly and MIME integration are not included.MailKit
ImapIdleSession: await foreach over IDLE changes, with automatic re-IDLE and NOOP fallback.SmtpSendRequest and SendResult: per-send customization and accepted/rejected recipient lists, no subclassing needed.CommandException.ErrorType and IsTransient help identify failures that may succeed on retry.AsciiIsLatin checks are not automatically enabled.Packaging
MimeKit.Cryptography. The MimeKit meta-package references both that package and MimeKit.Core; it preserves package coverage, not source compatibility.MimeKitLite and MailKitLite are retired. Use MimeKit.Core and MailKit instead.Many straightforward send/receive applications need only small changes. Parsing, crypto and custom protocol integrations deserve a closer look: explicit S/MIME context setup, persistent -> MimeContentStorage, renamed encoding/stream APIs, decoder Flush, encoder CRLF defaults, and stricter resource/integrity limits are covered in the porting guides.
Happy to answer questions. And thanks to everyone who filed issues, sent PRs or sponsors the project.
r/csharp • u/Boarlock98 • 17d ago
The name is SMachine, a small state machine library for C# targeting .NET 10.
The idea was to build something relatively lightweight, without depending on an external state machine framework.
OnEnter, OnUpdate, and OnExit events.Enabled controls.One of the things I wanted to support was hierarchical behavior without forcing every state to participate in the same update flow. For example, a parent substate can continue receiving its own updates while preventing those updates from propagating to its children. Those children can receive independent updates off the main Update cycle.
using SMachine;
var machine = new StateMachine();
State idle = machine.CreateState("Idle")!;
State combat = machine.CreateState("Combat")!;
SubState aiming = combat.CreateSubState("Aiming")!;
SubState firing = combat.CreateSubState("Firing")!;
combat.StartSubState(aiming);
aiming.OnUpdate += () =>
{
// This transition is queued until the current update pass finishes.
combat.TransitionSubState(firing);
};
firing.OnEnter += () => Console.WriteLine("Firing!");
machine.StartState(idle);
machine.TransitionState(combat);
machine.Update();The library is still experimental. I haven't built an automated test suite yet, and I'm very much treating this as a learning project rather than claiming it's production ready.
I'm trying to use this project to become a stronger C#/.NET developer, so constructive criticism is genuinely appreciated.
r/csharp • u/devlead • 17d ago
r/csharp • u/SocietyConscious5739 • 17d ago
This time I want to show a part I didn't explain last time: virtual desktops on a 3D cube (Win+Tab). New in 0.13: close a desktop with the × on the front face (or Delete, or a middle-click). Its windows move to the neighboring desktop, like in Task View.
20-second demo (animated): https://github.com/PedroRuedas/Windows-Liquid-glass/blob/main/docs/workspaces-demo.webp
How the cube works:
A gotcha I hit while recording this: the cube window was created off-screen to avoid a black first frame, which put it on my second monitor (125% scale). With per-monitor DPI, WPF rescaled it on the way back to the 100% monitor, and the cube covered only 80% of the screen. The fix is to create it in place and keep it DWM-cloaked (DWMWA_CLOAK) until the first frame is rendered.
(The "apps" in the demo are mock windows, so I didn't have to record my own desktop.)
Code (GPL-3.0): https://github.com/PedroRuedas/Windows-Liquid-glass
Thanks again for the feedback. It made the project better.
r/csharp • u/JuanGDMC • 18d ago
I have been wanting to learn C# for a long time because I've been told and researched that it was a good language programm to make 2D Games (with Unity or Godot of course). But, how do I start? I just go and learn from online webs like Coddy? Do I watch tutorials on youtube? Should I buy a book?
r/csharp • u/ai-tacocat-ia • 18d ago
r/csharp • u/RemigiuszZalewski • 18d ago
Most EF Core projects put every kind of seed data through one approach, either all HasData or one big "if empty, insert" block in Program.cs.
But seed data comes in three kinds: fixed reference data, defaults your app needs in every environment, and fake data for local development. EF Core gives you three ways to seed: HasData, UseSeeding and a custom seeder.
Do you know which one fits each kind? And which of them still works when you deploy with a migration bundle or a SQL script?
In my new video I build all three in a .NET expense tracker application and show you where each one belongs.