发布模式下的 LINQ 连接错误
我使用 Sql Server 紧凑型数据库,并且我的 linq 查询在调试模式下正常工作,但在发布模式下出现错误! 我的查询使用“join”,例外情况是:
方法' [My_Project_Namespace.MyTransactions、My_Project_Namespace.Users]。 ' 不是属性访问器
这是我的 LINQ 查询:
var result = from transRow in db.MyTransactions
join userRow in db.Users on transRow.User_id equals userRow.Id
join clientRow in db.Clients on
transRow.Client_id equals clientRow.Id
select new
{
userId = transRow.User_id,
clientId = transRow.Client_id,
userName = userRow.Fname + " " + userRow.Lname,
clientName = clientRow.Fname + " " + clientRow.Lname,
reg_date = transRow.Reg_date,
value = transRow.Value
};
我的目标是用他的名字添加(或替换)用户 id,并用他的名字添加客户端 id。
I use Sql Server compact database, and my linq query work properly in debug mode, but it has error in release mode !
My query use "join" and the exception is:
The method '
[My_Project_Namespace.MyTransactions,My_Project_Namespace.Users].
' is not a property accessor
Here is my LINQ query:
var result = from transRow in db.MyTransactions
join userRow in db.Users on transRow.User_id equals userRow.Id
join clientRow in db.Clients on
transRow.Client_id equals clientRow.Id
select new
{
userId = transRow.User_id,
clientId = transRow.Client_id,
userName = userRow.Fname + " " + userRow.Lname,
clientName = clientRow.Fname + " " + clientRow.Lname,
reg_date = transRow.Reg_date,
value = transRow.Value
};
My aim is add (or replace) the user id with his name and also the client id with his name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如Oleksiy Gapotchenko(Eazfuscator.NET 开发人员)所说的此处
您需要在程序集级别添加此内容:
然后,所有匿名方法和类型都不会被混淆,并且(可能)会起作用......
as Oleksiy Gapotchenko (Eazfuscator.NET Developer) said here
you need to add this on the assembly level:
then, all of your anonymous method and types won't be obfuscated, and (probably) will work....
我发现这是因为使用了一些混淆器,例如“Eazfuscator.NET”。
但它可以与其他一些混淆器一起使用,例如“Babel”!
I found out that's because of using some obfuscators like "Eazfuscator.NET".
but it will work with some other obfuscators like "Babel" !