Click here to Skip to main content
15,507,425 members

Comments by hoernchenmeister (Top 122 by date)

hoernchenmeister 15-Jun-18 7:09am View    
Thanks for posting this. It is indeed a bouquet of interesting things. This might take me a while to go through it, but I am looking forward to it.
hoernchenmeister 15-Jun-18 7:08am View    
Thanks a lot for your contribution.
It is very much appreciated!
hoernchenmeister 10-Jun-14 10:35am View    
Thanks Peter for your answer.
Yes, you are right, these dll's are also installed in the GAC. But I did so with all versions before (removing the old one and adding the new one). That's where I am confused right now, because I really believe it worked like that before... All the projects that I own always reference the folder mentioned above and never the GAC...

Best regards
hoernchenmeister 8-Apr-14 2:39am View    
I checked the query using the SQL Analyzer tool and it creates a query like this when I use FirstOrDefault:
SELECT TOP 1 * FROM tblEmailPostbox WHERE id = @id I assume that's all right. ObjectSet does not contain records, it just represents the table object to query from.
Anyway Maarten, I really appreciate your help on this one.
Thanks a lot!
hoernchenmeister 7-Apr-14 9:25am View    
Thanks again Maarten for your time,
Resharper indeed told me to skip the Where clause :)
In this scenario context.TblEmailPostbox is an ObjectSet<tblEMailPostBox>. I am currently implementing the precompiled version of the query:

Func<emaildataentities, long,="" emaildatacontext.model.tblemailpostbox=""> getSingleEmailByIdQuery = CompiledQuery.Compile<emaildataentities, long,="" emaildatacontext.model.tblemailpostbox="">((context, emailId) => context.tblEMailPostBox.FirstOrDefault(f => == emailId));

and I invoke it like this: tblEMailPostBox oDataEmail = getSingleEmailByIdQuery.Invoke(context, id); just for improving the performance as I have read about.

I have run into the OutOfMemoryException about five times and it's a really big record (Email with attachments - structure is pretty old and was accessed mainly using a SqlDataReader).

Just to make sure I understood correctly. You mentioned I should "query the right records from the database, instead of querying everything and resolving it in your application (as you are doing now)". This is confusing me a little because I assumed I would do it like that. The context variable is the ObjectContext I use for accessing the table. Would you mind to give me a little hint on how to query the right records only in this example?

I really appreciate your help Maarten,