Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
143 views

I found that I am regularly Trim()-ing whitespace from string values passed into my functions. This usually looks like: public void MyFunction(string param) { if (param != null) { // Null check is ...
RotundChinchilla's user avatar
1 vote
1 answer
665 views

In latest version of c# you can check not null with is not. I am using 7.3 version, How can I use is operator to check not null
Ankita's user avatar
  • 1,456
1 vote
1 answer
54 views

I work on an ASP.NET MVC project. I face issue action ApprovalIndex is not redirecting to action PendingManagersRequests although no error happens. I debug and trace breakpoint until reach action ...
ahmed abdelaziz's user avatar
0 votes
2 answers
140 views

I'm currently rewriting a Joystick Usercontrol from the old typical codebehind usercontrol into a MVPVM WinUI 3 and having a problem referencing a UIElement from the presenter class. Yes I know you ...
Keyboard_Kowboy's user avatar
4 votes
1 answer
3k views

I was using the "or pattern" in my C# code, but I am getting the following error: CS8370 Feature 'or pattern' is not available in C# 7.3. Please use language version 9.0 or greater. I ...
Marwie's user avatar
  • 3,347
0 votes
1 answer
890 views

I have a C# project in Godot that I've just updated from C# 7 to C# 10 and .NET 6. Everything works fine and I get no errors in VS code but when I try to build the project from the Godot game engine I ...
BetterLifeR's user avatar
0 votes
2 answers
65 views

I would like to print out more than six lines of six random numbers, but array bound is blocking me. I have set my array 'numbers' to six in order to always get just six random numbers, but now I dont ...
Martin's user avatar
  • 9
0 votes
0 answers
448 views

I'm trying to follow one of the tutorial for Xamarin application. My VS is: Microsoft Visual Studio Community 2019 Version 16.11.5 VisualStudio.16.Release/16.11.5+31729.503 Microsoft .NET Framework ...
Oleksandr Ragoza's user avatar
2 votes
1 answer
738 views

I'm converting an old application over from VB.Net to C# and got most of the converting done, but ran into an error message that should not be there (can't use "using static ..." in a couple ...
MC9000's user avatar
  • 2,443
0 votes
1 answer
143 views

I am building an generic SelectListItem to be used with a dropdown. Trying to cast an Enum of type T to its type , but Iam missing something. LocalizedStringKeyFor complains that its getting two ...
Jerker Pihl's user avatar
6 votes
1 answer
7k views

So I'm trying to utilize C# 8 in my .NET 4 web application by adding two entries in my .csproj file right inside the PropertyGroup node. <LangVersion>8.0</LangVersion> <Nullable>...
Mark Denom's user avatar
  • 1,067
3 votes
3 answers
821 views

So after searching for similar questions, I haven't seen any results. The error that keeps popping up is Feature 'target-typed conditional expression' is not available in C# 7.3. Please use language ...
Bojan Petkovski's user avatar
1 vote
1 answer
1k views

I'm working on source code which processes 2GB of data which represents 60 seconds of network traffic. The total processing time is around 40 seconds. I'm trying to optimize my code for performance as ...
jscarle's user avatar
  • 1,320
1 vote
0 answers
1k views

I would like to make an entire Control and its children have a see-through effect so that it looks disabled. My Control was initially a UserControl but trying to change the alpha on the BackColor ...
CausingUnderflowsEverywhere's user avatar
0 votes
3 answers
1k views

I have 3 models 1st Model public class BlogPosts { public int BlogID { get; set; } public int UserID { get; set; } public string PostTitle { get; set; } [AllowHtml] ...
Muhammad Zubair KHan's user avatar
0 votes
0 answers
63 views

I have an interface like this: public interface SomeInterface<A, B, C> where A : SomeAClass, SomeAClass2 where B : SomeBClass where C : SomeCClass, SomeBClass, EtcClass { A ObjA { get; } B ...
Kermalis's user avatar
0 votes
1 answer
955 views

More than probably this is a conceptual misunderstood but I want to know why. I've a static method that can return one generic value T, and it also receives a string. public static T GetWordType<...
Lotan's user avatar
  • 4,313
0 votes
0 answers
83 views

Sorry, I am new to config files and xml. This examples is close to what I want: Correct implementation of a custom config section with nested collections? (state-county-example). Unfortunatelly code ...
B. Ernst's user avatar
0 votes
0 answers
215 views

I'm trying to declare a Func<T, TResult> for a static method on a struct that has in parameters. The signature of my method is something like this: public static MyStruct MyMethod(in MyStruct ...
MattB's user avatar
  • 149
0 votes
1 answer
319 views

This Works public static T? Read<T>(object value) where T : struct { return (T)Convert.ChangeType(value, typeof(T)); } But this doesn't work: Error CS8370 Feature '...
deveton's user avatar
  • 361
2 votes
1 answer
190 views

Is there a difference between !(x is null) and x is object? Are there cases where they will return different results?
kofifus's user avatar
  • 19.7k
0 votes
0 answers
257 views

I have a project where I am attempting to use Unit of Work w/ Repository design pattern for performing CRUD operations using EF Core. FWIW, I am on .NET Core 2.2. Question: Is there a way for me to ...
ablaze's user avatar
  • 722
0 votes
1 answer
453 views

i have to upload pdf on server on his particular folder. but tried upload code as below. after pdf save and load on my site it's show "Failed to load PDF document." i check uploaded pdf on server it,...
Vikas Shinde's user avatar
0 votes
0 answers
398 views

I want to transfer one of the structures from the DXGI library, but I ran into a problem. The target structure contains a pointer to an array of structures, in the second after, where the first ...
user avatar
7 votes
1 answer
6k views

Is there a way to allow a list of tuples to deconstruct to a List<T>? I get the following compile error with the following code sample: Cannot implicitly convert type 'System.Collections....
rhughes's user avatar
  • 9,643