This article is the third in a series of articles not written by me, but by José F. Romaniello. He is a big NHibernate guy, so, he created a sample domain trying to evaluate how close the latest Entity Framework 4.1 Code First stuff is getting to NHibernate features,
Later, he chose to show how to do the same Code-First mapping using NHibernate and confORM, NHibernate mapping library that is created by Fabio Maulo, a primary developer in NHibernate source code.
I asked him to do it also with FluentNHibernate, so, he took the time and effort to create a nicely put visual studio solution. at some point he gave it to me as I was familiar with FluentNHibernate in general, not with automapping, which we wanted to use for this sample. so, I am now posting about this experiment.
This article’s very late than it should. Apologies to those who have been waiting.
Convention Based Mapping, AKA, Automapping
My audience is slightly different than Jose, I might need to explain this one. skip if not needed.
Read the full post ... (2298 words, 7 images, estimated 9:12 mins reading time)
Code Reading, Code Snippets, FluentNHibernate, NHibernate
This is a PowerPoint Presentation (and extraction of the contents) I made as per a couple of friends’ request (@EmadAshi and @AmrEldib) to show how OAuth works along with Twitter and how easy it is to cache OAuth credentials.
As I was doing related work for TweetToEmail. I felt a PowerPoint presentation will be even better than a blog post for this one, but here you get the two.
The Presentation
The Contents
Application Registration
- A Twitter user creates a Twitter Application
- If the application is web based, it needs to provide a URL. “Localhost” is not accepted as a domain for this URL
- A Twitter Application gets two pieces of information
- Consumer Key
- Consumer Secret
- A Twitter Application will use these in all coming requests.
Initializing The Process
- User comes to the application and it decides to authenticate against Twitter
- Application makes a request using Consumer Key and Secret to obtain “Oauth Request Token”, which consists of two parts
- Application makes authentication URL including the “Oauth Request Token” parameter, and optionally a “Call-back URL” (if different than default URL in first step)
Read the full post ... (505 words, 5 images, estimated 2:01 mins reading time)
.NET, ASP.NET, Code Gallery, Code Reading, Code Snippets, CodeProject, Local Events, twitter, Web 2.0
In NHibernate there is a Save(entityObject) method, which creates a new row in the database with the given entity object, also, has an Update(entityObject) which updates the row corresponding to the entity object with the property values of this object. It also has a SaveOrUpdate(entityObject) method, which checks the whether the entity object corresponds to an existing row in the database, and chooses whether to call Save(…) or Update(…) based on that.
The way I usually do web applications across multiple tiers, when not using view models specifically, makes me encapsulate much code in Services layer that sometimes does not need to care about whether the given entity is persisted in database or not. Thus wanted to have similar method using Entity Framework as ORM.
Of course I have implemented the method number of times and the code evolved based on which version of Entity Framework I’m coding against, and my knowledge of the framework internals as well. Actually, when you work with so many ORMs like I did, a new ORM or ORM version turns to only sound like “What’s new in the manual?” thing.
Read the full post ... (822 words, 2 images, estimated 3:17 mins reading time)
.NET, .NET FAQ, ADO.NET, C#, Code Snippets, Entity Framework, NHibernate

Microsoft has recently opened a new sub-site of MSDN, MSDN Code Gallery. Here’s their main statement:
Download and share sample applications, code snippets and other resources
MSDN Code Gallery is your destination for downloading sample applications and code snippets , as well as sharing your own resources.
Usually, people would go for community sites for code samples sharing, or create some open source area like CodePlex, creating projects that only work as sample base. Others would use those or the sample codes available in different MSDN dev centers from time to time for downloading code samples.
Now, we have the place for those little snippets :).
Start Downloading Code Samples and Create Your Own Right Away!
Permanent link to this post (118 words, 3 images, estimated 28 secs reading time)
Code Gallery, Code Snippets, Microsoft, MSDN