לפני מספר ימים עלה לאתר מאמרי MSDN בעברית מאמר שכתבתי בנושא Entity Framework.
המאמר הינו ברמת היכרות ומטרתו להציג את הטכנולוגיה ואופן השימוש ב-EF.
המאמר מיועד גם למי שלא מכיר את הטכנולוגיה וגם לאלו שמשתמשים ב-EF ומעוניינים להכיר את הארכיטקטורה של המוצר.
תודה לגיא בורשטיין ממיקרוסופט על העלאת המאמר. אם הייתם רוצים לראות עוד מאמרים בעברית בנושא Entity Framework, אשמח לקבל בקשות לנושאים (בין אם ברמת מתחילים או מתקדמים).
אם כבר עסקיננו ב-Entity Framework, ב-6 לספטמבר 2009 אני אעביר הרצאה בנושא Entity Framework ב-Web Developers Community (קהילת/קבוצת מפתחי WEB), פרטים על המפגש ניתן למצוא באתר ההרשמה
Today I’ve encountered a strange problem running expressions - I wanted to created an expression tree that looks something like this:
(e) => e.Owner != null && e.Owner.ID = 4455
So I’ve used the Expression.MakeBinary method to create a binary expression and passed it an ExpressionType.And enum, thinking this is the C# “&&” operator.
When running the expression on an e instance that had no owner (null), I got an exception. When looking at the created expression it looked something like this:
(e) => e.Owner != null AND e.Owner.ID = 4455
At first I didn’t notice any difference (I just thought the ToString() created an easy-to-read string), but after comparing it with the same expression written by hand with a lambda expression, I noticed the difference between the “AND” operator and the “&&” operator.
As it turns out, ExpressionType.Add is actually a bit-wise operator (similiar to &) and the enum that matches the && operator is the ExpressionType.AndAlso (the && operator is what is called a short-circut evaluator).
This is the same with the || (or) operator – the ExpressionType.Or is the bitwise or, whilst the ExpressionType.OrElse is the actual “||” operator.
I honestly think that it would have been better if they named this types as ExpressionType.BitwiseAnd and ExpressionType.And – makes more sense, doesn’t it?
So be careful the next time you want to use and/or in your expression tree.
Further links:
http://en.wikipedia.org/wiki/Short-circuit_evaluation
http://msdn.microsoft.com/en-us/library/bb353520.aspx
The IDCC sessions are open for voting
Among the session, you can find 2 of mine :
1. Creating Data Access Layers with ORM tools
After Entity Framework came out, I kept hearing people say “They say EF is good, but NHibernate is more mature, so why use EF?”, so in this session we’ll take a look at the two ORM tools, how they work and how you can use them to build a DAL for your application – you’ll be the judge.
There are 2 more recommended session about Entity Framework from two of my colleagues at Sela – Gil’s Entity Framework Tips & Tricks, and Erez’s session about using EF with Oracle, both are recommended.
2. Speed up your applications with Microsoft's Distributed Cache ("Velocity")
Cache mechanism are good – they boost applications performance and they supply work for architectures that plan them and consultants that fixes them after they are discovered to have flaws. So why invent the wheel over and over again? In this session we’ll take a look at Microsoft’s Distributed Cache (AKA Velocity) which allows us to incorporate distributed cache into our application’s front-end and back-end.
I myself still haven’t decided which lectures I want to hear, too bad it isn’t a two-days event (ahhmmm, hint hint …)
This week, I’ve tried to build a team build for a project I’m working on. I found it weird that for some reason, building the server solutions worked just fine, but I wasn’t able to build the silverlight solutions - it always failed. Looking a bit in the log file, I saw that the build failed because it couldn’t copy the .XAP files of the silverlight application from the ClientBin folder. Checking a bit further and I found that the files were never created !
After searching the internet I found out the problem – I’ve installed the Build server after it already had silverlight SDK installed on it – apparently there is a significance to the order of installations – you need to install the build server first and then install the silverlight SDK.
If you’ve already installed SL and then the Build server, just reinstall the SL SDK and it will work.
Another problem I’ve encountered afterwards was a problem with the build order of the silverlight projects – It seemed that MSBuild did not recognize correctly the order of the projects to build and it missed some projects and caused the build to fail, but setting the dependencies for the missing projects fixed that (strange how everything works fine when building solutions in the IDE).