比如以下查询:
var qry = (
from item in _context.Table1
select new SomeModel
{
Name = "A"
}
)
.Union
(
from item in _context.Table2
select new SomeModel
{
Name = item.UserName
}
).ToList();
查询抛出异常:Unable to translate set operation when matching columns on both sides have different store types.
这是什么原因?UserName也是string类型,为什么无法转换?2.1版本并不会出现这样的问题。