Questions

C# questions

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

Debug EntityValidationErrors in Entity Framework 6 C#

Learn how to inspect DbEntityValidationException errors in Entity Framework 6, fix invalid seed data, and configure multiple foreign keys in C#.

csharpentity-frameworkentity-framework-4entity-framework-4.1

Declarative vs Imperative Programming in C#: A Practical Guide

Learn the difference between imperative and declarative programming in C# with clear examples, LINQ, comparisons, and practical exercises.

csharpparadigmsimperative-programmingdeclarative-programming

Deep Copy and Object Cloning in C#

Learn how deep copying and object cloning work in C#, with practical examples, pitfalls, and safe ways to duplicate objects.

csharp.netclonedeep-copy

Delete Directory Contents While Keeping the Root Folder in C#

Learn how to delete all files and subdirectories from a C# directory while preserving the root folder, with safe examples and common pitfalls.

csharp.net

Deserialize JSON into a C# dynamic Object

Learn how to deserialize JSON into a C# dynamic object, when to use it, its trade-offs, and practical examples with JSON libraries.

csharp.netjsonserialization

Does C# Have Extension Properties? Understanding Extension Methods and Alternatives

Learn whether C# supports extension properties, why it does not, and how to use extension methods or wrappers instead.

csharppropertiesextension-methods

Does try-catch Make C# Code Faster? Understanding Benchmarking, JIT Optimization, and Microbenchmarks

Learn why try-catch can appear faster in C#, and how JIT behavior, CPU timing, and poor microbenchmarks can mislead results.

csharp.netclrtry-catch

Dynamic OrderBy Strings for IEnumerable and IQueryable in C#

Learn how Dynamic LINQ string-based OrderBy works with IQueryable and IEnumerable, including AsQueryable, safe alternatives, and sorting examples.

csharplinqienumerableiqueryable

Encrypt and Decrypt Strings in C# with AES-GCM

Learn how to encrypt and decrypt strings securely in C# using AES-GCM, nonces, authentication tags, UTF-8, and safe key handling.

csharp.netencryptionmono

Expression<Func<T>> vs Func<T> in C#: What’s the Difference and When to Use Each?

Learn when to use Expression<Func<T>> instead of Func<T> in C#, with clear examples, execution differences, and real-world LINQ usage.

csharpdelegateslambdaexpression-trees

Fast Entity Framework Bulk Inserts: Batching, AddRange, and Transactions

Learn faster Entity Framework inserts with batching, AddRange, change tracking, bulk-copy options, and safe transaction timeout strategies.

csharpsqlentity-framework

Field vs Property in C#: What’s the Difference and When to Use Each

Learn the difference between fields and properties in C#, when to use each one, and how encapsulation affects real-world class design.

csharpooppropertiesfield

File Uploads in ASP.NET MVC 3 with HttpPostedFileBase

Learn to upload files in legacy ASP.NET MVC 3 using a multipart form, HttpPostedFileBase, validation, and safe server-side storage.

csharpasp.net-mvcasp.net-mvc-3

First vs FirstOrDefault vs Take(1) in LINQ with C#

Learn when to use First, FirstOrDefault, and Take(1) in LINQ with C#. Understand exceptions, defaults, and practical usage patterns.

csharp.netlinq

Fix IIS Metabase Access Errors in Visual Studio 2012

Learn why Visual Studio 2012 cannot access the IIS metabase and how IIS features, permissions, and project settings resolve the error.

csharp.netiisiis-metabase

Fix Open DataReader Errors in Entity Framework LINQ (C#)

Learn why Entity Framework throws an open DataReader error during nested LINQ queries and fix it with materialization or a single query.

csharpentity-frameworkentity-framework-4

Fixing "Could Not Find ... bin\roslyn\csc.exe" in ASP.NET MVC

Learn why ASP.NET MVC looks for bin\roslyn\csc.exe, what Roslyn packages do, and how to fix this missing compiler error safely.

csharpasp.net.netvisual-studio

Fixing Assembly Manifest Mismatch in C# (.NET): The Located Assembly's Manifest Definition Does Not Match the Assembly Reference

Learn why C# assembly manifest mismatch errors happen, how to find old DLL references, and how to fix version conflicts in .NET projects.

csharpreferencecompiler-errorsdependencies

Format Decimal Values to 2 Decimal Places in C#

Learn how to display C# decimal values with exactly two decimal places using ToString format specifiers, rounding rules, and culture-aware currency formats.

csharp.netformatdecimal

Format a C# DateTime as yyyyMMddHHmmss

Learn how to format C# DateTime values as yyyyMMddHHmmss using custom format strings, correct date tokens, UTC, and culture-safe output.

csharpdatetime

Page 3 of 9 - 162 questions