I'm new with C#. I'm writing window form for sorting files inside folder according to it extension. It's work when do the task with one folder but I m ...
I'm new with C#. I'm writing window form for sorting files inside folder according to it extension. It's work when do the task with one folder but I m ...
I'm trying to override a JsonConverter<T> in the System.Text.Json package which has an abstract Read method which can be ovveridden as: publ ...
so, if I have for example a struct PlayerData that has members of Vector3 structs defined in System.Numerics (not readonly structs) and I pass them ...
I would like to use yield in ref structure method: The compiler complains about the error: CS4013 Instance of type 'RefStruct' cannot be used i ...
I want to minimize copying of structs in a maths library and read about the C# 7.2 in modifier, especially the warnings when using it with mutable str ...
Consider the following extension methods: These simply toggle a ref boolean variable value. Testing: We get: The question: Is there any hidde ...
I have the following extension method for monitoring a variable and awaiting until it has a given expected value: It is working just fine: I wou ...
Why does the first call to Foo below compile but the second one results in an ambiguous invocation compiler error? (using c# 7.2) private static ...
C# Version: 7.2 My Ms Build version: Unknown (if anyone can tell me how to find it on my machine please do) My Version of Visual Studio: Visual Stud ...
I am creating test automation for my code generation library. I have a test project in C# 7.2. The project compiles with Visual Studio without any iss ...
Recently I was wandering if it's possible to compare structs by reference. As reading a struct variable creates a copy of that variable, comparing sta ...
I'm starting out with System.Buffers.MemoryPool<T> and System.Memory<T> in C#, looking to reduce allocations for byte arrays. I have a bu ...
I'm using a method from a legacy library: F (ref T t) where T: struct. It's declared as ref for performance reasons only and does not modify the data ...
Given the following class: As well as this usage: I am trying to figure out why it is that the GetDouble delegate conversion is considered ambig ...
I was reading documentation on C# 7.2 here and I came across this in regards to ref readonly: The compiler enforces that the caller can't modify t ...
So, I (think I) understand what the in parameter modifier does. But what it does appears to be quite redundant. Usually, I'd think that the only reas ...
In C# 7.2, we saw the introduction of the in modifier for method parameters to pass read-only references to objects. I'm working on a new .NET Standar ...
I have encountered a performance issue in .NET Core 2.1 that I am trying to understand. The code for this can be found here: https://github.com/mike- ...
Is it possible to use C# 7 discard operator with ref operator instead of out. Example: ...
This C# doesn't compile: The complaint from the compiler is: The type 'IdList' already contains a definition for 'Item' If I comment out the ...