LINQ join error in Release mode
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,
va开发者_运维知识库lue = transRow.Value
};
My aim is add (or replace) the user id with his name and also the client id with his name.
as Oleksiy Gapotchenko (Eazfuscator.NET Developer) said here
you need to add this on the assembly level:
[assembly: Obfuscation(Feature = "anonymous type properties renaming", Exclude = true)]
then, all of your anonymous method and types won't be obfuscated, and (probably) will work....
I found out that's because of using some obfuscators like "Eazfuscator.NET". but it will work with some other obfuscators like "Babel" !
精彩评论