提交 0354a561 编写于 作者: M mgravell

use case insensitive property match first, with insensitive fallback

上级 7c29aa04
......@@ -449,7 +449,9 @@ private static object GetStructDeserializer<T>(IDataReader reader)
var setters = (
from n in names
select new { Name = n, Info = properties.FirstOrDefault(p => p.Name == n) }
let prop = properties.FirstOrDefault(p => string.Equals(p.Name, n, StringComparison.InvariantCulture)) // case sensitive first
?? properties.FirstOrDefault(p => string.Equals(p.Name, n, StringComparison.InvariantCultureIgnoreCase)) // case insensitive second
select new { Name = n, Info = prop }
).ToList();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册