Why is there a difference in sorting between SQL Server and C#?

Viewed 96

I am creating a table below

CREATE TABLE _testseif
(
    name NVARCHAR(max)
)

INSERT INTO _testseif (name)
VALUES (N'آ'), (N'ا')

When I sort these values:

SELECT * 
FROM dbo._testseif
ORDER BY name

I get these results:

result in sql

Now in C#, I wrote a unit test as shown here:

[TestMethod]
public void TestMethod1()
{
    var li = new List<string>() { "آ" ,"ا" };

    var li1 = li.OrderBy(x => x).ToList();
}

And the result I get is this:

Result in c#

Why is there a difference in sorting between SQL Server and C#?

0 Answers
Related