While I was planning to write about the same topic and have the draft ready in my Windows Live Writer waiting to complete, I found an interesting question in StackOVerflow and couldn’t just resist to answer:
The question starts with:
I’m starting a new project and I’m looking around for either a very good ORM or for a non-SQL-based persistence layer.
Then follows up with a REALLY GOOD summary of what he believes about each known ORM he knew out of his own findings and search. I advice you to go read it.
However, all this investigation didn’t get him to a single choice answer. And I can’t blame him. This is one fo the questions that will remain for so long without a single answer, or maybe having the popular “It depends” answer.
I have had a LONG research in this topic as well. I have read for so long (and watched videos/casts) to make sure of the best usage of many ORMs and then used them sometimes in test projects sometimes in production, and I wanted to share my thoughts based on this. I posted a long answer there on the question in StackOverflow, and I want to share this answer with you here. I may also have a second part of this post based on my existing Windows Live Writer draft, but, based on my previous times, I think I won’t!
Read the full post ... (1189 words, 3 images, estimated 4:45 mins reading time)
.NET, .NET FAQ, ALT.NET, Domain Driven Design, Entity Framework, FAQ, LINQ, LINQ To SQL, LLBLGen, NHibernate, ORM
Emad Ashi (
@splashup on twitter) interviewed me in the 5th episode of his first Arabic podcast series
DotNetArabi to talk about Object Relational Mapping in .NET in Arabic.
السلام عليكم
أصدقائي العرب ممن يتابعون هذه المدونة.. يسعدني أن أعلن عن أول حديث لي على الانترنت – و كذلك أول حديث لي على الانترنت بالعربية، عن الـ Object Relational Mappers – ORMs
الحلقة 5: محمد مليجي يتكلم عن الـ ORM (Object Relational Mapping)
محمد مليجي تكلم عن الـ ORM (Object Relational Mapping) و هي برامج مساعدة تستطيع من خلالها نقل المعلومات و تحويلها من طبيعة قاعدة البيانات إلى طبيعة البرامج المبنية بأسلوب الـ Object Oriented. حلقة غنية بالتفاصيل و المعلومات القيمة جدا.
Read the full post ... (374 words, 2 images, estimated 1:30 mins reading time)
.NET, ALT.NET, DotNetArabi, General News, LINQ, Local Events, ORM
Allow me to quote here some emails I sent to the the Dot NET developers group in my company, Injazat, or, as we call ourselves, Ninjazat. I thought it’ll be useful to share some with you as well.
· ASP.NET MVC – 20 Hours of FREE Video Tutorials
· LINQ FAQ
o LINQ FAQ for Newbie’s
o LINQ FAQ Part 2
· How we handle application configuration
· ScottGu ASPNETMVC Session Video Available Now (Part 1/2 & 2/2)
· Web Validation: Best Practices and Tutorials
· Building a Single Sign On Provider Using ASPNET and WCF
o Part 1
o Part 2
o Part 3
· NxtGenUG Cambridge: Creating extendable applications using MEF slides and code
· Dynamic Languages and .NET – Developer Day Scotland slides and code samples
· patterns & practices: Data Access Guidance (VS 2010 Stuff)
· Refactoring challenge
o Part 1 – Examination
o Part 2 – Preparation
· LINQ is not LINQ To SQL
Read the full post ... (300 words, 2 images, estimated 1:12 mins reading time)
.NET, .NET FAQ, ASP.NET, ASP.NET MVC, DLR, Link List, LINQ, MEF, Miscellaneous, MVC, WCF, Web Design
Just in case you missed the news, Yahoo has created it’s own query thingy. No, no LINQ provider, it’s a “query language”. Check it out!
Quote:
What is YQL?
Yahoo! makes a lot of structured data available to developers, primarily through its web services. These services require developers to locate the right URLs and documentation to access and query them which can result in a very fragmented experience. The YQL platform provides a single endpoint service that enables developers to query, filter and combine data across Yahoo! and beyond. YQL exposes a SQL-like SELECT syntax that is both familiar to developers and expressive enough for getting the right data. Through the SHOW and DESC commands we enable developers to discover the available data sources and structure without opening another web browser.
How Do I Get Started?
- Check out the YQL Console.
- Read how to access YQL from your application.
- Get your Access Keys to sign your requests if you need them.
Usage limits
YQL has the following API usage restrictions:
Per application limit (identified by your Access Key):
Per IP limits:
- /v1/public/* 1000 calls per hour
Read the full post ... (265 words, 2 images, estimated 1:04 mins reading time)
General News, Link List, LINQ, Web 2.0, Yahoo, YDN
If you don’t know what eager loading is, Jump to “What’s eager loading?”.
Eager Loading Syntax
If you are eager loading Products for example in a typical (Categories 1<->* Products) relation, the standard syntax would like:
DbDataContext.Categories.Include(“Products”)
What is the problem with that?
The “Products” part. The word “Products” is a string. If I rename the Products table to ShopProducts or whatever or even remove it from this data diagram and have it elsewhere, or even something wrong happens and the relation is removed from DB/diagram by mistake, my code will still compile, but will fail when it runs. This is BAD BAD BAD.
How to solve this?
Since I always believe that if something exists somewhere you shouldn’t do it yourself unless its totally broken (and I mean REALLY REALLY BROKEN), I started searching inside the Entity Framework itself for something to get the entity name from.
At first it seemed super easy. Every entity class has a static property “EntityKeyPropertyName”, so, I thought I can write something like:
DbDataContext.Categories.Include(Product.EntityKeyPropertyName); // But this didn’t work
Read the full post ... (2487 words, 3 images, estimated 9:57 mins reading time)
.NET, .NET FAQ, ADO.NET, C#, CodeProject, LINQ