DCSIMG
tips and tricks - Ido Flatow's Blog Veni Vidi Scripsi

Ido Flatow's Blog

Veni Vidi Scripsi

News

Have you heard me speak?
Powered
<style type='text/css' media='screen' id='sm_css'> #smix {overflow: visible;height: auto;border-radius: 10px;max-width: 250px;background-color: #323232;text-align: left;font-size: 12px;line-height: 16px;font-family:'Lucida Sans Unicode','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;-webkit-border-radius: 10px;-moz-border-radius: 10px;border-radius: 10px;} #smix a {color: #0056CC;text-decoration: none;} #smix .sm_head {color: #fff; line-height: 1em;font-size: 1.4em;padding: 10px;color: #fff;} #smix .sm_lanyard_wrapper {background-color: #fff;;clear: both;width: 97%;margin: 0 auto;margin-bottom: 0px;} #smix .sm_lanyard_content {padding: 7px;}#smix button.sm_rec, #smix a.sm_rec, #smix input[type=submit].sm_rec { padding: 6px 10px; -webkit-border-radius: 2px 2px;-moz-border-radius: 2px; border-radius: 2px; border: solid 1px rgb(153, 153, 153); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(255, 255, 255)), to(rgb(221, 221, 221))); color: #333; text-decoration: none; cursor: pointer; display: inline-block; text-align: center; text-shadow: 0px 1px 1px rgba(255,255,255,1); line-height: 1; }#smix .sm_rec:hover { background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(248, 248, 248)), to(rgb(221, 221, 221))); }#smix .sm_rec:active { background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(204, 204, 204)), to(rgb(221, 221, 221))); }#smix .sm_rec.medium { padding: 3px 7px; font-size: 13px; }#smix .sm_rec span.icon.thumbs_up {background-position: 0px 36px;vertical-align: text-top;display: inline-block;margin-right: 4px;height: 18px;width: 16px;background-image: url(http://speakermix.com/images/new/thumbsold.png);}#smix .sm_rec:hover span.icon.thumbs_up {background-position: 0px 18px;} #smix .sm_events {padding:2px 0px 4px 0px;} #smix .sm_section {font-size: 10px; border-bottom: 1px solid silver; margin-bottom: 6px;} #smix .sm_subline {font-size:120%;margin-top:4px;font-weight:bold} #smix .powered {text-align: right} #smix .powered img {margin: 7px} </style>
Sela Technology Center

Advertisement

Browse by Tags

All Tags » tips and tricks (RSS)
Handling SOAP Faults In Silverlight
In the past, when we tried to connect from Silverlight 2 to WCF Services that threw exceptions (every now and then), we got the famous “Not found” Communication Exception. The reason we didn’t get a SOAP Fault is that WCF returns SOAP Fault responses with a HTTP code of 500 – this is according to SOAP protocol , but the browser doesn’t allow 500 responses to be returned to Silverlight – it replaces them with a CommunicationException and thus hides the real fault that returned. When we moved to Silverlight...
Implementing Composite design pattern in Entity Framework
Last week, a colleague of mine asked me to create a sample composite design pattern model in Entity Framework. I thought to myself, no problem, created the table that contains the Component, Leaf & Composite entities (according to TPH – Table Per Hierarchy) and went to build the EDM based on the table and there I started to have problems which needed manual fixing. Since I’m working with EF 3.5, I’ve built the DB prior to the model – In EF 4.0 you can do model-first and build your db by script...
Entity Framework View Generation Fixup
A few day ago, a colleague of mine, Shlomo Goldberg , raised a question about Entity Framework and large models. Another colleague of mine, Gil Fink posted some links to helpful tips for using large models, and I want to talk about one of these tips – using the View Generation option. If you’ve worked with large models in Entity Framework 3.5, you probably noticed that as the model grows, it takes more time to initialize the ObjectContext for the first time. A solution to this is to use view generation...
Migrating Entity Framework’s EDM from Sql Server to Oracle
A few weeks ago I've published a post regarding DataDirect's new Oracle provider that supports EF. I was able to download DataDirect’s provider only this week, so it will take me a few more days to examine it and post some notes. As for now, I would like to share with you some of the issues in EF we’ve came across migrating from Sql Server to Oracle, using the provider from DevArt . BTW, we haven’t fully migrated to Oracle just yet, our project supports working with both databases using a...
Entity Framework doesn’t support web services + entity inheritance
Entity Framework supports entity inheritance, which is a basic requirement for O/R mappers. When exposing a model through a service, either an ASMX WS or a WCF service, a WSDL will be created that among other things describes the structure of the entities, including the inheritance tree of the entities - This is done to allow creation of methods that return polymorphic types. EF supports derived entities through WCF services with data contract serialization using the KnownTypeAttribute which is added...
Change Entity Framework storage DB schema in runtime
When you build a EF schema, it automatically plant the name of the imported tables schema into the EDMX file. But alas, what happens when you work in different environments (such as Dev, Test, Prod...) and in each database, the schema of the tables is different? Basically you either reset all your databases to use the same schema or worse - change the EDMX and recompile the assembly before updating the wanted environment. But there is another solution, not a clear one, probably not a supported one...
Entity Framework and Lazy Loading
I've received a couple of request to write some of my previous posts in English so that all other 99.7% of the developers community in the world which finds these subjects interesting can understand what I'm writing. The following post is a translation to English of this Hebrew post . When Entity Framework (EF for short) was designed, Microsoft decided the loading of entities will be during run-time in a JIT like mechanism. They achieved this by using the lazy loading technique - access the...
שמות Properties כמחרוזות - חלק 2
להלן בעיה - בהנתן Property כלשהו, נניח ששמו FirstName, עליכם להעביר למתודה את שם ה-Property כמחרוזת, תחת המגבלות הבאות: אינכם יכולים לרשום במפורש את שם ה-Property כמחרוזת ("FirstName") אינכם יכולים להשתמש ב-GetProperties, איכשהו לאתר את ה-PropertyInfo ולחלץ את שמו ממאפיין Name (לדוגמה - איתור ה-PropertyInfo הראשון שמתחיל ב-F ואורך שמו הוא 9) לפני כשנתיים נתקלתי בבעיה זו, כאשר וחיפשתי דרך לפתור את הבעיה שהוצגה בפוסט הקודם - העברה של שמות מאפיינים למתודה וקבלת ערכיהם (אז לא עלה בדעתי להשתמש...
שמות Properties כמחרוזות
ברצוננו לכתוב מתודה אשר תקבל שם קובץ חדש ורשימת קבצים בתיקייה ותחזיר שם קובץ תקין שאינו קיים בתיקייה (כמו שיצירת קובץ חדש בתיקייה תחת וינדוס יוצרת קבצים בשם "new", "new1", "new2" וכו'). string GetUniqueFileName(List<File> files, string newFileName) נוכל לכתוב מתודה אשר עוברת על רשימת הקבצים בתיקייה (List כלשהו) ומחפשת עפ"י מאפיין שם קובץ (obj.FileName) אם השם תפוס ואם כן, להוסיף לשם שהועבר איזשהו Suffix ולנסות שוב עד למציאת שם תקין. עכשיו בואו נסבך - נניח...
שיתוף קבצי קוד בין פרויקטים
לפני שבועיים סשה פרסם פוסט על שיתוף קבצי Contract בין Service ל-Client שלו. הקונספט הזה העלה לי זכרונות ישנים לגבי פעולה זו וכדאי לשים לב לכמה דברים : 1. שיטה זו של קישור ע"י Link עובדת כל עוד היחס בין המסלולים (Path) נשמר בכל מחשבי הפיתוח - ברוב המקרים זה כך, אך יש לשים לב לכך בשביל שלא יווצרו broken links. 2. פתרון אפשרי אחר, למי שעדין עובד עם ה-VSS הישן של MS הוא לבצע Share של קובץ הקוד בין תיקיות הפרויקטים השונות ובכך לייצר עותק מקושר המנוהל ברמת ה-Source Control ולא ב-Studio. כך אפשר להתגבר...