Questions

C# questions

Choose a question page, learn the concept, then test your understanding with a quiz.

How to Group by Multiple Columns in LINQ (C#)

Learn how to group by multiple columns in LINQ using C#. See syntax, examples, execution steps, common mistakes, and a practical mini project.

csharp.netlinqgroup-by

How to Iterate Over a Dictionary in C#

Learn the standard ways to iterate over a Dictionary in C#, including KeyValuePair, keys, values, and common beginner mistakes.

csharpdictionaryloops

How to Loop Through Enum Values in C#

Learn how to iterate over all enum values in C# using Enum.GetValues, with examples, common mistakes, and practical use cases.

csharp.netenumslanguage-features

How to Mark a Method as Obsolete or Deprecated in C#

Learn how to deprecate methods in C# using the Obsolete attribute, with examples, warnings vs errors, and migration tips.

csharp.netversioningdeprecated

How to Pass a Method as a Parameter in C# Using Delegates

Learn how to pass a method as a parameter in C# using delegates, Func, and lambdas with simple examples and common mistakes.

csharp.netmethodsdelegates

How to Query a DataTable with LINQ in C#

Learn how to use LINQ with DataTable in C#. Understand AsEnumerable, Field<T>(), filtering rows, and common mistakes with DataTable queries.

csharp.netlinqdatatable

How to Randomize a List<T> in C#

Learn how to shuffle a List<T> in C# correctly using Random and the Fisher-Yates algorithm for lottery apps and other practical cases.

csharplistrandomshuffle

How to Read app.config and web.config Settings in .NET Class Libraries

Learn how to read app.config or web.config settings in a .NET class library using ConfigurationManager and modern .NET config practices.

csharp.netconfigurationappsettings

How to Run a .NET Application as Administrator on Windows 7

Learn how a .NET app requests administrator rights on Windows 7 using manifests, UAC, and elevation best practices.

csharp.netwindows-7administrator

How to Send an HTTP POST Request in .NET

Learn how to send HTTP POST requests in .NET, including JSON bodies, form data, headers, and best practices with HttpClient.

csharp.netposthttpwebrequest

How to Set the Content-Type Header with HttpClient in C#

Learn how to correctly set the Content-Type header in C# HttpClient requests and avoid the Misused header name exception.

csharpasp.netrestcontent-type

How to Sort a Dictionary by Value in C#

Learn how to sort a Dictionary by value in C# using LINQ, with examples, pitfalls, and practical patterns for real projects.

csharp.netsortingdictionary

How to Sort a List<T> by an Object Property in C#

Learn how to sort a List<T> by object properties in C# using Sort, LINQ OrderBy, ThenBy, and custom comparisons.

csharpgenericslistsorting

How to Split a String by Newlines in .NET (C#)

Learn how to split a string by newlines in .NET using C# with Split, Environment.NewLine, and mixed line ending handling.

csharp.netstringsplit

How to Update the GUI from Another Thread in C# WinForms

Learn the safe way to update a WinForms Label from another thread in C#, using Invoke, BeginInvoke, and thread-safe UI patterns.

csharp.netmultithreadingwinforms

How to Use GroupBy in LINQ to Group Objects and Collect Values in C#

Learn how to use LINQ GroupBy in C# to group people by PersonID and collect related values like car names into lists.

csharplinqgroup-by

How to Use LINQ Distinct by Property in C#

Learn how to get distinct objects by one or more properties in C# using LINQ, equality comparers, GroupBy, and modern DistinctBy examples.

csharplinqduplicatesunique

IEnumerable vs List in C#: LINQ Execution and Performance

Learn when to use IEnumerable<T> or List<T> in C#, how LINQ queries execute, and when ToList() improves safety or performance.

csharplinqlistienumerable

IQueryable vs IEnumerable in C#: Differences, Deferred Execution, and When to Use Each

Learn the difference between IQueryable and IEnumerable in C#, how deferred execution works, and when to return each in real applications.

csharplinqlinq-to-sqlienumerable

Implement INotifyPropertyChanged Gracefully in C#

Learn practical ways to implement INotifyPropertyChanged in C#, including SetProperty helpers, CallerMemberName, source generators, and MVVM tools.

csharp.netwinformsinotifypropertychanged

Page 6 of 9 - 162 questions