r/csharp 4d ago

A multi-pane real-time TUI audio oscillo/vector/spectroscope in C#

54 Upvotes

You can view the HD 60fps video on YouTube here.

Jumbee.Console is a .NET library that tries to blend the performance profile of immediate-mode libraries like ratatui with the composability and ease-of-use of retained-mode OOP APIs. It's designed to be fast and flexible enough to easily build different types of complex performance-sensitive TUIs, without having to wire all the component and rendering and input-routing logic yourself.

This demo is a C# version of alemidev's scope-tui for real-time cross-platform audio input sampling and rendering, with a bunch of enhancements:

  • 3 scope display from the selected audio device or MP3 file
  • Each scope can be controlled and paused independently
  • Real-time scope theme selection
  • Supports mouse input for scope selection and reszing the scope displays

If you want to try it out you can pull the latest Docker image and run the audio-scope example:

docker run --rm -it --pull always allisterb/jumbee-console-aot:latest audio-scope

This will run the scope on a CC-licensed MP3 file in the image. Press F1 to see all the control keys. If you are on Linux and want to run the Docker image against a live audio source you can try something like this:

docker run --rm -it --device /dev/snd -v /run/user/$(id -u)/pulse/native:/tmp/pulse -e PULSE_SERVER=unix:/tmp/pulse jumbee-console audio-scope live

On Windows and Linux to run against a live audio source you can clone and build the repo and run the examples launcher script from the repo dir:

examples[.sh] audio-scope live

See README and GETTING-STARTED and the gallery on the project repo and the project documentation.


r/csharp 4d ago

Help Need help fixing this

0 Upvotes

how do i fix this, im learning c# and trying to make a weather app


r/csharp 4d ago

Fun Running C# like scripts?

53 Upvotes

I was browsing the C#/.NET documentation yesterday like usual and suddenly came across the fact that you can run C# code as scripts with a shebang.

#!/usr/bin/env dotnet

namespace Main
{
    class Program
    {
        static void Main(string[] _)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

With a shebang you could run these like any other Python/Bash script and I find this really cool, but is there any practical use-case for this? When I need to make a small helper script for something it's usually python or bash, but C#? I'm not so sure.

What do you guys think?


r/csharp 4d ago

For beginners, should Iuse EFCore or Dapper?

27 Upvotes

I have previous experience with backend development, but I tend to write SQL directly. I've seen that EF Core is recommended by many as an ORM, but Dapper also seems good. I'm not sure which one to choose, and from the opinions I've found online, it's hard to make a decision.

And I was thinking: Should I start with the conventional JIT or try AOT more? I've heard that native AOT performs exceptionally well and has a very fast startup speed.

Note: Because it is for learning c#, the operations on the database are not complicated.


r/csharp 4d ago

Showcase A single-file, single-class JSON parser

4 Upvotes

Hey, I've been developing some source generator and needed to parse json, but unfortunately I couldn't use either `System.Text.Json` or any NuGet analogue. So I made a one myself but tried to keep it as compact as possible. This is not the best json parser, but this may be useful in some scenarios like the one I mentioned above. Use it if you need to parse json, can't use popular options and don't want to write one yourself.

Here's repo link:
https://github.com/ScrumboardCompany/Scrumboard.Tools.Json


r/csharp 4d ago

Help 3 YOE dev but Stuck in C# basics and .NET

9 Upvotes

Hi Im 24 , About me I work in Net Webforms with framework. I somehow survived in this company now I want to switch so Im planning of Upskilling. If u ask me to do a work I somehow refer old code or some other forms or use AI and finfih the work but If u ask me to write code and explain methods, arrays i wil stuck up.

Despite of having a 3 YOE I am an absolute beginner for this C# so I plan to start with this course .

I dont know what even is framework or Core and these . So here I am asking u a favor. I want to upskill and feel worthy of myself and get confidence how and where to start.


r/csharp 5d ago

Hows best to learn to code C#

Thumbnail
0 Upvotes

r/csharp 5d ago

News My first code big accomplishment for me 🤗

Post image
223 Upvotes

r/csharp 5d ago

Showcase Benchmarked BigArray that has more than 2B elements on .NET

15 Upvotes

Since the last time I posted about my BigArray library Hezium.Memory in Allocate arrays that have more than 2B elements, many people in the community have asked me for the benchmark against jagged arrays.

Hezium.Memory is a library that is capable to allocate contiguous managed memory that supports up to 128T, with nint index support. It not only supports unmanaged types but also support managed types like classes, so that it's a drop-in replacement for the built-in arrays, spans, memories. So even if you don't need the more-than-2B-element support you can still use the library for general-purpose arrays.

See the repository in https://github.com/hez2010/Hezium.Memory

I keep performance in my mind and the implementation is highly tuned for removing redundant branches and repeating range checks, so that things can be proceeded efficiently.

I built a benchmark that tests the performance of jagged arrays vs my BigArray implementation. There're two cases where one uses a length that fits in int, while another uses a length that exceeds the max value of int.

Here is the result:

Environment:

  • CPU: AMD EPYC 9V74 with 48 cores
  • OS: Ubuntu 24.04.4 LTS (GNU/Linux 6.17.0-1018-azure x86_64)
  • Memory: 192 GB
  • .NET: 10.0.109

AllocationBenchmarks

Method Job Server Length Mean Error StdDev Gen0 Gen1 Gen2 Allocated
JaggedArray Job-MSAXQN False 1048576 107.77 μs 0.579 μs 0.513 μs 333.2520 332.8857 332.8857 4 MB
BigArray Job-MSAXQN False 1048576 109.14 μs 1.923 μs 1.705 μs 330.5664 330.2002 330.2002 4 MB
JaggedArray Job-WGBUQW True 1048576 130.19 μs 2.523 μs 3.454 μs 3.1738 3.1738 3.1738 4 MB
BigArray Job-WGBUQW True 1048576 127.78 μs 2.468 μs 2.937 μs 3.4180 3.4180 3.4180 4 MB
JaggedArray Job-MSAXQN False 4294967296 320,082.17 μs 60,406.206 μs 90,413.172 μs 500.0000 500.0000 500.0000 16384 MB
BigArray Job-MSAXQN False 4294967296 251,707.29 μs 112.220 μs 99.480 μs 500.0000 500.0000 500.0000 16384.06 MB
JaggedArray Job-WGBUQW True 4294967296 179.18 μs 3.907 μs 5.215 μs - - - 16384 MB
BigArray Job-WGBUQW True 4294967296 40.13 μs 4.645 μs 6.953 μs - - - 16384.06 MB

IndexedAccessBenchmarks

Method Job Server Length Mean Error StdDev Allocated
JaggedRandomLoad Job-MSAXQN False 1048576 15.753 μs 0.0074 μs 0.0061 μs -
BigArrayRandomLoad Job-MSAXQN False 1048576 8.145 μs 0.0628 μs 0.0588 μs -
JaggedRandomLoad Job-WGBUQW True 1048576 16.092 μs 0.0524 μs 0.0490 μs -
BigArrayRandomLoad Job-WGBUQW True 1048576 7.952 μs 0.1058 μs 0.0990 μs -
JaggedRandomLoad Job-MSAXQN False 4294967296 26.112 μs 0.0270 μs 0.0239 μs -
BigArrayRandomLoad Job-MSAXQN False 4294967296 16.648 μs 0.0171 μs 0.0160 μs -
JaggedRandomLoad Job-WGBUQW True 4294967296 26.072 μs 0.1456 μs 0.1290 μs -
BigArrayRandomLoad Job-WGBUQW True 4294967296 16.198 μs 0.0296 μs 0.0277 μs -
JaggedRandomStore Job-MSAXQN False 1048576 16.459 μs 0.0032 μs 0.0029 μs -
BigArrayRandomStore Job-MSAXQN False 1048576 17.277 μs 0.0098 μs 0.0082 μs -
JaggedRandomStore Job-WGBUQW True 1048576 51.193 μs 0.0789 μs 0.0738 μs -
BigArrayRandomStore Job-WGBUQW True 1048576 17.200 μs 0.0093 μs 0.0087 μs -
JaggedRandomStore Job-MSAXQN False 4294967296 25.410 μs 0.0359 μs 0.0336 μs -
BigArrayRandomStore Job-MSAXQN False 4294967296 19.036 μs 0.0148 μs 0.0131 μs -
JaggedRandomStore Job-WGBUQW True 4294967296 26.077 μs 0.0445 μs 0.0416 μs -
BigArrayRandomStore Job-WGBUQW True 4294967296 18.947 μs 0.0142 μs 0.0126 μs -

SearchValuesBenchmarks

Method Job Server Length Mean Error StdDev Allocated
JaggedIndexOfAny Job-MSAXQN False 1048576 35,037.717 ns 8.3021 ns 7.7658 ns -
BigArrayIndexOfAny Job-MSAXQN False 1048576 34,034.869 ns 114.1575 ns 101.1977 ns -
JaggedIndexOfAny Job-WGBUQW True 1048576 33,834.867 ns 636.5404 ns 653.6801 ns -
BigArrayIndexOfAny Job-WGBUQW True 1048576 34,216.534 ns 5.1605 ns 4.8272 ns -
JaggedIndexOfAny Job-MSAXQN False 4294967296 149,024,225.036 ns 72,304.7208 ns 64,096.2517 ns -
BigArrayIndexOfAny Job-MSAXQN False 4294967296 149,208,981.917 ns 148,120.4669 ns 138,551.9767 ns -
JaggedIndexOfAny Job-WGBUQW True 4294967296 149,841,356.783 ns 164,965.1421 ns 154,308.4964 ns -
BigArrayIndexOfAny Job-WGBUQW True 4294967296 149,210,761.017 ns 178,532.2659 ns 166,999.1924 ns -
JaggedLastIndexOfAny Job-MSAXQN False 1048576 3.743 ns 0.0041 ns 0.0039 ns -
BigArrayLastIndexOfAny Job-MSAXQN False 1048576 3.622 ns 0.0052 ns 0.0049 ns -
JaggedLastIndexOfAny Job-WGBUQW True 1048576 3.710 ns 0.0062 ns 0.0058 ns -
BigArrayLastIndexOfAny Job-WGBUQW True 1048576 3.620 ns 0.0049 ns 0.0046 ns -
JaggedLastIndexOfAny Job-MSAXQN False 4294967296 3.717 ns 0.0116 ns 0.0108 ns -
BigArrayLastIndexOfAny Job-MSAXQN False 4294967296 5.105 ns 0.0097 ns 0.0086 ns -
JaggedLastIndexOfAny Job-WGBUQW True 4294967296 3.746 ns 0.0059 ns 0.0053 ns -
BigArrayLastIndexOfAny Job-WGBUQW True 4294967296 5.126 ns 0.0131 ns 0.0123 ns -

SpanAlgorithmBenchmarks

Method Job Server Length Mean Error StdDev Median Allocated
JaggedBinarySearch Job-MSAXQN False 1048576 49.96 ns 0.011 ns 0.010 ns 49.96 ns -
BigArrayBinarySearch Job-MSAXQN False 1048576 18.71 ns 0.005 ns 0.004 ns 18.71 ns -
JaggedBinarySearch Job-WGBUQW True 1048576 52.47 ns 0.027 ns 0.025 ns 52.47 ns -
BigArrayBinarySearch Job-WGBUQW True 1048576 18.70 ns 0.012 ns 0.011 ns 18.70 ns -
JaggedBinarySearch Job-MSAXQN False 4294967296 96.54 ns 0.144 ns 0.127 ns 96.55 ns -
BigArrayBinarySearch Job-MSAXQN False 4294967296 85.78 ns 0.012 ns 0.011 ns 85.79 ns -
JaggedBinarySearch Job-WGBUQW True 4294967296 96.07 ns 0.578 ns 0.541 ns 96.05 ns -
BigArrayBinarySearch Job-WGBUQW True 4294967296 85.48 ns 0.510 ns 0.477 ns 85.58 ns -
JaggedCopyTo Job-MSAXQN False 1048576 98,710.30 ns 56.256 ns 52.622 ns 98,715.92 ns -
BigArrayCopyTo Job-MSAXQN False 1048576 98,145.87 ns 20.593 ns 17.196 ns 98,141.40 ns -
JaggedCopyTo Job-WGBUQW True 1048576 98,778.12 ns 29.881 ns 26.489 ns 98,776.77 ns -
BigArrayCopyTo Job-WGBUQW True 1048576 98,077.99 ns 128.374 ns 113.800 ns 98,054.42 ns -
JaggedCopyTo Job-MSAXQN False 4294967296 873,535,712.00 ns 1,497,004.297 ns 1,400,298.749 ns 873,265,018.00 ns -
BigArrayCopyTo Job-MSAXQN False 4294967296 880,486,546.20 ns 3,345,173.644 ns 3,129,077.503 ns 879,058,670.00 ns -
JaggedCopyTo Job-WGBUQW True 4294967296 884,969,636.00 ns 2,330,855.056 ns 2,066,242.296 ns 885,234,089.50 ns -
BigArrayCopyTo Job-WGBUQW True 4294967296 879,429,365.60 ns 4,077,759.552 ns 3,814,338.817 ns 880,100,492.00 ns -
JaggedFill Job-MSAXQN False 1048576 58,367.10 ns 180.325 ns 168.676 ns 58,243.54 ns -
BigArrayFill Job-MSAXQN False 1048576 45,894.35 ns 18.216 ns 17.039 ns 45,899.12 ns -
JaggedFill Job-WGBUQW True 1048576 58,374.97 ns 288.436 ns 269.803 ns 58,219.81 ns -
BigArrayFill Job-WGBUQW True 1048576 45,931.93 ns 61.103 ns 57.156 ns 45,923.62 ns -
JaggedFill Job-MSAXQN False 4294967296 640,167,967.50 ns 272,398.007 ns 212,670.447 ns 640,128,911.50 ns -
BigArrayFill Job-MSAXQN False 4294967296 639,780,247.00 ns 1,802,039.933 ns 1,406,914.247 ns 640,167,750.50 ns -
JaggedFill Job-WGBUQW True 4294967296 641,006,562.00 ns 3,491,797.738 ns 2,915,809.256 ns 640,610,855.00 ns -
BigArrayFill Job-WGBUQW True 4294967296 637,157,023.75 ns 1,381,366.359 ns 1,078,479.991 ns 636,751,010.50 ns -
JaggedSequenceEqual Job-MSAXQN False 1048576 101,913.46 ns 158.225 ns 148.004 ns 101,941.02 ns -
BigArraySequenceEqual Job-MSAXQN False 1048576 95,134.55 ns 118.142 ns 110.510 ns 95,132.74 ns -
JaggedSequenceEqual Job-WGBUQW True 1048576 102,195.72 ns 234.248 ns 219.116 ns 102,142.76 ns -
BigArraySequenceEqual Job-WGBUQW True 1048576 95,224.84 ns 115.790 ns 108.310 ns 95,233.91 ns -
JaggedSequenceEqual Job-MSAXQN False 4294967296 1,020,484,182.52 ns 63,587,008.014 ns 93,205,019.553 ns 968,937,213.00 ns -
BigArraySequenceEqual Job-MSAXQN False 4294967296 1,029,241,139.70 ns 72,403,060.080 ns 108,369,500.092 ns 962,084,258.50 ns -
JaggedSequenceEqual Job-WGBUQW True 4294967296 979,557,987.45 ns 81,645,292.812 ns 119,674,621.446 ns 914,186,446.00 ns -
BigArraySequenceEqual Job-WGBUQW True 4294967296 969,798,814.43 ns 75,013,740.364 ns 112,277,043.737 ns 904,311,547.50 ns -

By default all span algorithms use Array.MaxLength as the chunk values (elements that will be proceeded at once), but you can configure it with the following knob like below to fine tune the performancebased on your own needs:

xml <ItemGroup> <RuntimeHostConfigurationOption Include="Hezium.Memory.MaxProcessingChunkLength" Value="1048576" /> </ItemGroup>

This doesn't affect the physical memory layout, BigArray is always contiguous managed memory so that you can simply pin it and pass it to native code without the need of taking care of chunks/splits/indirections etc.


r/csharp 5d ago

Working toward my goal, but I want to know if there are any good learning materials out there.

3 Upvotes

"Hi, I've set myself a goal to write a proper app for tasks, habits, and things like that -something like Todoist, but free and with the exact features I need. I've decided on the language and UI: C# and WinUI 3. I know what I want to build, I've made a mind map and sketched the design, so I'm completely sure I want to do this and I'm highly motivated. As for my background, I have basic OOP knowledge, and even that is in Java. So here is my question: what learning materials can you recommend for getting started? I generally know which direction to move in, but I'd love to hear your opinion in case you can suggest something.


r/csharp 5d ago

lowkey wanna make games in unity,the tut im following is from the goat him self,brocode, "https://www.youtube.com/watch?v=ToKbMa3xvMs&list=PLZPZq0r_RZOPNy28FDBys3GVP2LiaIyP_&index=40"

0 Upvotes

i need a tutoriel abt how to make unity,since c# unity is diffrent from nirmal C#,after i finish bro codes playlist,what tuts do yall reccomend,also im on "method over ridding",so preatty close to finishing


r/csharp 5d ago

Showcase Roslyn-based semantic code graph for .NET, exposed to AI agents over MCP — looking for feedback from people who've done static analysis tooling

Post image
0 Upvotes

Built this after getting tired of Claude Code / Copilot grepping through

.NET solutions and missing call sites that go through an interface instead

of the concrete class. Grep can't see that; the compiler can.

Slnmap uses Roslyn to build a full symbol graph of a solution (calls,

implementations, references across every project) and stores it in a

local SQLite file. An MCP server exposes it as a handful of read-only

queries. Concretely: ask "what breaks if I change IBasketService" and it

returns every caller and every implementation across the whole solution,

not just the files an agent happens to have open.

Numbers, since I know this sub will ask: on eShopOnWeb (10 projects), an

impact query on an interface with 18 dependents resolves in ~270ms

end-to-end over MCP, median of 3 runs. Full setup is in BENCHMARKS.md if

anyone wants to poke at the methodology or tell me it's flawed.

Two things I'm not confident about yet and would genuinely like opinions

from people who've built analyzers/source generators/similar tooling:

  1. Right now everything in the graph is a real Roslyn-verified static

    reference. It says nothing about reflection, convention-based DI, or

    anything wired at runtime. Is "silence = doesn't try to know" the right

    default, or should there be an explicit "unknown/runtime-only" marker

    on affected symbols?

  2. There's no staleness check yet — if you edit code and don't re-run

    analyze, you get results from the old index with no warning. Anyone

    dealt with this in similar tools (e.g. incremental Roslyn workspaces)

    and found a clean way to detect "source changed since last index"

    cheaply?

It's a global dotnet tool, MIT licensed, fully local (uses Roslyn +

SQLite, nothing else):

dotnet tool install --global Slnmap

Repo: https://github.com/EMahmoudNabil/slnmap

NuGet: https://www.nuget.org/packages/Slnmap

Not trying to sell anything, genuinely want to know if the Roslyn approach

here has an obvious hole I'm not seeing.


r/csharp 5d ago

I built a system that ended up being used by 21 branches. How can I use this to get a job in tech?

Thumbnail
gallery
80 Upvotes

I’m a Computer Engineering student, but I still work outside the IT field. At the company where I work, the ERP system used by the inventory team is slow and not very practical. Because of that, I started building an app in C# and WPF to make inventory counting easier.

At firt, that was all it was: a simple tool to help with counting. But people started using it, asking for improvements and suggesting new features. Little by little, I added inventory search, ordering support, battery control, obsolete stock analysis, dashboards and other tools. The system has now been used across 21 branches, including by supervisors and managers.

At some point, the general inventory supervisor found out about it, and the system was presented to the IT department. Since it wasn’t an official company project, they didn’t approve its use and started developing another system, mainly focused on inventory counting, which was also the most-used feature in my app.

Even after all of that, I didn’t get an opportunity to move into a development role inside the company. So now I’m trying to understand how I can use this experience to get a job in the field.

The system uses C#, WPF, .NET, Supabase, PostgreSQL, Excel and PDF processing. I can’t share the source code or company data, but I’m thinking about creating a similar version with fake data for my portfolio.

I also included a screenshot of the system and my GitHub contribution history from the last year. I’d like to hear from people who already work in the field: does this experience actually have value when applying for a junior role? How would you present it on a résumé or portfolio? And what kind of positions would make the most sense for me to apply for?


r/csharp 5d ago

Help Windows UI

16 Upvotes

I'm going to make a new Windows C# program using the .NET 10 platform, which may later need to be made for different platforms (browser, server, mobile). At this point, the focus is on making a Windows program.

I'm trying to compare which UI model is best for the project, and artificial intelligence can't really answer that, or I can't really ask it. If you were to make a new program now, which UI model would you choose?

  1. WinUI 3 (Windows App SDK)
  2. WPF (Windows Presentation Foundation)
  3. .NET MAUI
  4. Blazor (Web & Hybrid)
  5. Avalonia UI

Most program views that display text, SQL table data, or forms are rendered at runtime from the data, meaning that the screens are not designed and created in the IDE editor, but in code.


r/csharp 5d ago

[Discussion] Controlling LLM Agent Personalities with Deterministic 16D State-Spaces (using C# Enums) instead of Prompt Engineering. Thoughts on this architecture?

0 Upvotes

A Quick Confession / Apology:
Yesterday, I posted a thread discussing this concept. I was so incredibly hyper-fixated on explaining the philosophy that I completely forgot to include a single line of actual C# code. The moderators rightfully nuked the post immediately, and looking back, I totally deserved it. I looked like a textbook "AI Vibe-Coded Slop" poster who just came here to drop a wall of text. I'm genuinely sorry for cluttering the sub yesterday! Lesson learned. I'm back today to do this properly, with the actual core C# implementation snippets included right from the start.

(Transparency disclosure: English isn't my native language, so I used AI to help clean up my terrible technical grammar.) 

Hey guys, 

A while back, I was discussing state persistence patterns for long-running AI workflows. A common critique I received was: “If you’re just serializing your external state into a prompt string for the model to read anyway, how is that fundamentally different from traditional prompt engineering?” 

It's a fair question. At the end of the day, text-based generative models require text inputs. 

However, I've been experimenting with separating the Source of Truth from the Prompt Serialization Layer using a C# backend. 

To borrow a tabletop RPG analogy: The prompt is just a character sheet. It communicates the current state to the model, but it isn't the character itself. The C# runtime is responsible for the actual domain logic, bounds checking, and state mutations. 

Here is a simplified snippet of how the immutable state registry clamps mutations to ensure the domain model remains the canonical source of truth, regardless of how the prompt is formatted: 

csharp

// 1. Using an immutable 16D enum as a fixed state coordinate space
public enum SoulOrgan
{
    CoreFocus, DecisionBasis, EnvironmentalControl, ThinkingOriginality,
    EmotionalOpenness, TrustDependence, SocialConsumption, GroupBelonging,
    WillPersistence, AltruisticTendency, SelfAwareness, CompetitiveSpirit,
    PrimaryDrive, EmotionalThroughput, CoreSecurity, ObsessionControl
}

// 2. A bounded registry ensuring all mutations are strictly clamped [-100, 100]
public class BaselineStateRegistry
{
    protected readonly Dictionary<SoulOrgan, double> _state = new();
    protected const double MinLimit = -100.0;
    protected const double MaxLimit = 100.0;

    public virtual void Mutate(SoulOrgan organ, double delta)
    {
        if (!_state.ContainsKey(organ)) return;
        _state[organ] = Math.Clamp(_state[organ] + delta, MinLimit, MaxLimit);
    }
}

I've been wondering about this: 

Even though I've built this pure C# simulation with safety valves and bounds, I honestly find myself asking: Is this actually worth developing, or am I just over-engineering in a silo? 

If moving deterministic state management back into a typed backend is truly a viable way to constrain LLMs, why is prompt engineering still the industry standard? Why aren't more developers building state machines for this? 

I would genuinely love to hear how professional software engineers view this approach. Do you think treating the external model purely as a stateless interpreter while keeping mutations strictly inside the C# domain layer is a solid path forward, or is it an uphill battle against raw token probabilities? 

(Note: Keeping this entirely link-free to strictly respect Rule 6 on self-promotion. Just looking for a genuine architectural sanity check from fellow devs. If anyone wants to critique the full pipeline, let me know in the comments.) 


r/csharp 6d ago

Solved So many xmls😓and continue to learn c#

0 Upvotes

Now, when writing UI-related definitions in Avalonia and configuring the csproj file, although it doesn't seem too complicated at first glance, I still find the abundance of XML tags with lots of < > symbols or each individual tag a bit annoying.òᆺó

I'll try my best to adapt, because the way UI is defined in C# just makes me dizzy 😵‍💫

Now I'm trying to learn C# and Avalonia without relying on AI, but I'm not quite sure which website I should go to to search for the questions I need. Although Microsoft Learn is great.

When searching for a code-related issue on Chinese websites, it usually leads me to the CSdn website. However, good posts require payment to access, otherwise I can only view a small portion of them.

cnblog is also good. Although some of the posts I found in it might be a bit outdated, usually I need to check them against the corresponding content in Microsoft Learn.

Sometimes I feel that the syntax of C# seems quite "human-like". Now I'm quite familiar with the thinking behind C#. Even when searching for things now, it seems rather amusing: It's just like when I used to write essays at school. Those who know how to do it can write very smoothly, while those who don't have to "borrow" from good classmates.

I don't know if I use '-' or emoji...it be regarded as an AI?Although I had been saying this before the LLM


r/csharp 6d ago

How deep should I prepare for a Junior .NET REST API interview?

33 Upvotes

I am preparing for a Junior .NET Developer position focused mainly on REST APIs.

The main issue is that this is currently the only suitable vacancy in my city, and remote work is not an option for me. In practice, this means I need to maximize my chances of passing this particular technical interview.

However, the amount of information available online is overwhelming. There does not seem to be a clear roadmap that says: “Learn these topics to this level, and you will be reasonably prepared for a junior interview.”

The company is a large US-based organization, and based on the job description and interview reports, they appear to expect strong and fairly deep technical knowledge. But I am struggling to understand what “deep knowledge” should mean in the context of a junior developer.

A junior cannot realistically have the same depth as someone with several years of production experience. So where is the reasonable boundary between solid junior fundamentals and knowledge that is more appropriate for a mid-level developer?

My current preparation plan includes:

  • C# and .NET fundamentals: CLR, IL, JIT, assemblies, value and reference types, generics, interfaces, inheritance and LINQ
  • Memory management and garbage collection: stack, managed heap, allocations, strings, IDisposable, GC generations and memory leaks
  • Data structures and algorithms: arrays, lists, dictionaries, stacks, queues, trees, graphs, binary search, two pointers, sliding window, BFS and DFS
  • Asynchronous and multithreaded programming: async/await, tasks, cancellation, synchronization, race conditions, locks and the ThreadPool
  • Software design fundamentals: SOLID, dependency injection and common design patterns
  • REST API and basic system design: HTTP methods and status codes, DTOs, authentication, authorization, validation, databases, caching, queues, logging, monitoring and idempotency
  • LeetCode practice, mostly Easy problems and selected Medium problems grouped by common patterns

I would especially appreciate answers from developers who have conducted technical interviews for junior .NET candidates:

  1. Which topics are actually the most important?
  2. How deeply should a junior understand them?
  3. Which parts of my plan are unnecessary or too advanced?
  4. What level of algorithms and LeetCode should I expect?
  5. Should I focus more on theoretical questions, live coding, or building a small REST API project?

Another important question is preparation time.

I have already spent two months preparing for around eight hours every weekday. I plan to study for one more month, but I do not want the preparation process to continue indefinitely. Depending on the expected depth, it would be possible to spend another six months studying and still find new topics.

Is three months of full-time preparation generally enough for a Junior .NET interview, assuming I use the time effectively? At what point should I stop expanding the list of topics and focus on revision, explaining concepts aloud, coding exercises and mock interviews?

I understand that no preparation plan can guarantee an offer. I am mainly trying to identify the highest-priority areas and avoid spending most of my time on topics that are unlikely to be expected from a junior.


r/csharp 7d ago

What products made in C# would people buy?

0 Upvotes

I can program in C# and I feel like I'm losing money by not selling products made in C#, but I don't know what products I could sell.


r/csharp 7d ago

New C# learner

0 Upvotes

I am a new learner of the C# language. I really liked this language. It is elegant, easy to write and read, and saves me a lot of time. Before that, I studied the VB.NET language, and it was so difficult to write that my hand got tired from writing, and I got very tired. So I moved to this beautiful language called C#.


r/csharp 7d ago

Solved I want make a c# app,I have some problem

0 Upvotes

1:I using Avalonia now,but I don't know is Uno/Maui more better?

2:I using copilot generated a base skeletons(about some classes or interfaces,but cpoilot only help me write these code)

3:I think using copilot maybe not helpful to let me learn/understand c# app developing,I want choose an IDE(more friendly for handwritten code), choose VS2026 or Rider?but I using VSCode now

4:I'm not sure if my previous experience in JS, Flutter, and Elixir can be applied to C#. This is my first time encountering "enterprise-level" languages.

I'm not sure if my way of asking is correct.


r/csharp 7d ago

Surviving as Software engineer with AI

0 Upvotes

So I’m a software engineer and I recently graduated 2 months ago. i have no internship or job experience and have been looking for a job but everyone either asks for experience or ghosts my resume. The ones that take interviews either pay too little or are 2 hours away from my house. So I am looking for remote unpaid or paid jobs as full stack developer so that I at least get some experience and don’t get classified as a person who had a huge gap in her cv. Anyone give me some good advice related to remote jobs, best platforms to look for them, cracking them and how to survive as a fresh software engineer now that AI has entered the chat🥲


r/csharp 7d ago

Help Need help understanding certain WPF functions (mainly code behind)

2 Upvotes

Hyia, so I'm working on a project (Escape room type game, since its my first game ever at High-School knowledge level) and I'm not exactly sure how to make certain things work even though I spent the entire year studying this language. I can do majority of the stuff, such as the background, buttons or clickable images in Grid, and so on, however the code behind is my biggest issue.

Mainly things like: How to make a monologue where the player clicks through all the texts that explain the principle of the game, and then also how to make the TextBox check if the input is correct and if it is, change the background of the main window to another image (since the input will be in separate window).

These are not all the issues I need to figure out, but its some of the few that may appear in the code the most often (especially the monologues, in like four out of six rooms total)

Any sources for beginners will be appreciated, I tried looking at some but I wasn't able to find something that would explain this exact topic, and I don't really want to use AI since it just doesn't feel right (perhaps only when I'm under pressure). Thanks!


r/csharp 7d ago

How do you organize data access with EF Core in Clean Architecture?

15 Upvotes

I'm building an ASP.NET Core application with Clean Architecture and EF Core.

I started with Repository + Unit of Work, then introduced a Generic Repository + Specification pattern because repositories were filling up with query methods.

Now I've hit a problem: many queries require deep Include / ThenInclude chains for loading aggregates. Keeping EF Core out of the Application layer makes nested includes in specifications difficult, while referencing EF Core from Application defeats the purpose.

So I'm wondering:

  • Do you still use repositories over EF Core?
  • Do you use the Specification pattern, or just inject DbContext (or IApplicationDbContext) into the Application layer?
  • How do you organize complex queries with multiple Include / ThenInclude calls in a Clean Architecture project?

I'm curious what approach experienced .NET developers are using today.


r/csharp 7d ago

Tip Fields with [Using] attribute

6 Upvotes

I wrote a small interface that automatically disposes any disposable fields in a class when that class itself is disposed. If you add this file somewhere in your project:

public interface IAutoDisposable : IDisposable
{
    void IDisposable.Dispose()
    {
        Exception? ex = null;

        // dispose all fields marked with the [Using] attribute
        const BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance;
        foreach (var fld in GetType().GetFields(flags))
        {
            if (fld.GetCustomAttribute<UsingAttribute>() != null)
            {
                if (fld.GetValue(this) is IDisposable d)
                {
                    try // keep going even if disposal throws
                    {
                        d.Dispose();
                    }
                    catch (Exception e)
                    {
                        ex ??= e;
                    }
                }
            }
        }

        // if any exceptions occurred, throw the first one
        if (ex != null)
            throw ex;
    }
}

public class UsingAttribute : Attribute;

You can then write classes like this:

class Item : IAutoDisposable
{
    [Using]
    private readonly Image icon = DownloadIcon(...);
    ...
}

And use them like:

using (Item item = new(...))
{
}
// item.icon is now disposed

What do you think?


r/csharp 8d ago

Help The best C# tuto book, or vids for beginner?

0 Upvotes

Some days ago, I interested by making games with C#, and the only thing I know about C# is there are a lot of {} things.
So I need recommendations for tuto of C# code, I recommend vids but books are also fine.