Skip to content
MAKOLYTE

MAKOLYTE

Solve real coding problems

  • About
  • Latest
  • C#
    • ASP.NET
    • Event-driven
    • EF Core
    • Visual Studio
    • WinForms
    • Windows Service
  • Java
    • Setup
    • Spring
    • AWS
  • Python
  • SQL
    • SQL Server
    • MySQL
  • Principles and Practice
    • Algorithms
    • Design Patterns
    • Dependency Injection
    • Refactoring
    • Unit Testing

ThenByDescending

C# – How to sort by multiple fields

10/16/202007/13/2020 by Mak

Use OrderBy() and ThenBy() when you want to sort by multiple fields, like this: Note: These are Linq extension methods, so make sure to add a reference to System.Linq. Ascending vs Descending order By default, OrderBy() and ThenBy() sort in ascending order. If you want to sort by descending order, use the Descending version of … Read more

Categories C# Tags Linq, OrderBy, Sorting, ThenBy, ThenByDescending Leave a comment

Categories

  • C# (314)
    • ASP.NET (41)
    • Console App (10)
    • EF Core (15)
    • Event-driven (12)
    • Visual Studio (25)
    • Windows Service (3)
    • WinForms (22)
  • Git (2)
  • Java (7)
    • AWS (5)
    • Setup (1)
    • Spring (6)
  • JavaScript (3)
  • Notepad++ (1)
  • Postman (4)
  • PowerShell (2)
  • Principles and Practice (80)
    • Algorithms (16)
    • Data Structures (9)
    • Dependency Injection (15)
    • Design Patterns (11)
    • Refactoring (6)
    • Unit Testing (31)
  • Python (3)
  • SQL (50)
    • MySQL (5)
    • SQL Server (43)

Tags

ApiController appsettings.json ASP.NET AsyncAwait Attributes C# ConfigureServices Dapper DateTime Dependency Injection Dictionary EF Core Enum Exception Extension Methods foreach Generics GetAsync hashset HttpClient Install-Package JSON JsonConvert.DeserializeObject JsonConverter JsonSerializer JsonSerializer.Deserialize() JsonSerializerOptions Linq mocking Moq Newtonsoft.JSON Nuget Parameterized Unit Test Performance Performance Comparison Refactoring SELECT SQL Server StringBuilder System.Reflection System.Text.Json Threading unit testing Visual Studio WinForms

Privacy Policy

  • Privacy Policy
© 2022 MAKOLYTE • Built with GeneratePress