如何根据文化获得有序列表?

时间:2017-03-23 06:27:11

标签: c# lambda cultureinfo

这可能是一个被公开的问题,但我的项目有问题。书籍'名称包括多字节字符串,如ÇĞİŞÖÜ。如果我使用它们而不进行这样的培养:

private readonly LinqtoSQLiteDataContext _connection = new LinqtoSQLiteDataContext();
var books = _connection.books.OrderBy(f => f.name);
GridControlBooks.DataSource = books; 

输出如下:

![enter image description here

但是,İnternet Ortamında Kişilik Haklarının İhlâli...必须位于Günümüz Türkçe'siyle Mecelle之后。我试过这个:

private readonly LinqtoSQLiteDataContext _connection = new LinqtoSQLiteDataContext();
var culture = new CultureInfo("tr-TR");
var books = _connection.books.OrderBy(f => f.name, StringComparer.Create(culture, false));
GridControlBooks.DataSource = books;

但它会返回如下错误:

An unhandled exception of type 'System.NotSupportedException' occurred in Devart.Data.Linq.dll Additional information: Unsupported overload used for query operator 'OrderBy'.

我该如何解决问题?

0 个答案:

没有答案