Inheritance and Associations with Entity Framework Part 2

by mosessaur| 29 September 2008| 5 Comments

In the previous part I discussed Table-per-Hierarchy Inheritance, in this part I'll go through Table-per-Type Inheritance model. There is a video demonstrating this model if you wish to watch. Here I'll update my previous sample with new entities that demonstrate the Table-per-Type Inheritance model. For the differences between 2 models and definitions return to 1st part. The updated sample can be downloaded from here.

How to define a model with Table-per-Type Inheritance:

At the beginning I'll explore the database design for this subject, and explain why Table-per-Type must be used to model the inheritance:

More...

Inheritance and Associations with Entity Framework Part 1

by mosessaur| 24 September 2008| 3 Comments

In this multi parts series I'll explore how to build inheritance with Entity Framework showing 2 different approaches of inheritance in Entity Framework. Beside that I'll show how to build simple association between 2 entities and show how to provide custom code to retrieve other parts of the relation when inheritance is applied.

My plan not to exceed 3 parts as the subject is not that huge, it is just the demonstration with screen shots that will make the post large that is why I divided it to multi part. I am not good at screen casts beside I don't have a software license to produce one.

Inheritance Types in Entity Framework:

There are 2 models of Inheritance in Entity Framework and they both actually depends on the database design:

  • Table-per-Hierarchy Inheritance: One table in storage to maintain data for all the types in an inheritance hierarchy. So basically you have one table in database, but different types in your Entity Model that inherits from a base class and all mapped to that table. This post will focus on this type of Inheritance.
  • Table-per-Type Inheritance: Separate table in storage to maintain data for each type in the inheritance hierarchy. That means you might have several tables with one-to-one relationships. Each table is mapped to single Entity in the model. But there is a base Entity that is mapped to the very base table. This is going to be the subject of my next part of this short series. Till then you can watch this video about it.

About the Sample:

The sample I am going to demonstrate here with screen shots is taken from MSDN sample in the links specified above. I found them much clear and easy to demonstrate beside I wasn't able to come out with much simpler sample idea.

More...

jBlogMvc Series Started! Keep tuned with Amr Elsehemy

by mosessaur| 22 September 2008| 0 Comments

Amr Elsehemey started to blog about ASP.NET MVC. He picked up a good subject to blog about; and jQuery, he named it "" Yesterday he posted his first post in the series, and myself I am waiting for the rest of the series as for it is going to be very interesting, because I have couple of ideas in mind.

He is going to explore the code and posting samples as he developing this simple blog engine. We have been talking about this subject for few days now, and really he has some cool ideas to present. Keep tuned with Amr, I am sure he is going to amuse us with some kicking posts just as he did in his .

Username Availability Validator almost ready, the early demo

by mosessaur| 19 September 2008| 11 Comments

UPDATE: ALWAYS DOWNLOAD LATEST SOURCE CODE FROM PROJECT PAGE ON CODEPLEX

Few weeks ago Dave started the Advanced ASP.NET AJAX Server Controls book giveaway contest. And yesterday he announced that the control is almost completed, but the contest door is still open. So I thought to grape the bits and start testing it and build a simple sample. [View Demo]

The sample that I am going to demonstrate here will use ASP.NET Create User Wizard control with UserName Availability Validator. In this sample I'll show the important properties of this control as well as the current issues exist.

Prerequisites:

I'll assume that you already know how to configure and use the existing built in ASP.NET Membership provider. You'll need a sample database with ASP.NET Membership services installed on it.

The sample provided has ASP.NET Membership already installed and configured, you can download the sample and start explore it.

You page must have ScriptManager control on it, of course this is an ASP.NET AJAX control at the end.

More...

Localization\Globalization Considerations and Tips

by mosessaur| 18 September 2008| 4 Comments

I've been worked with localization and globalization for a while now. During that period I faced issues and learned many things about the subject. Here I am going to share some of my own ideas and tips to avoid falling in certain issues. It worth to mention that I am talking from GUI point of view and not Application Data point of view.

Consider using Resource Files ".resx" or Database:

Well this is a matter of your needs. But I highly recommends to always consider ASP.NET Resource Provider. Then it doesn't matter to work with ".resx" of Database. By default ASP.NET has a provider for XML based resources which is resource files ".resx" But also you can get a great Database Resource Provider for free from here.

Actually to choose between both you should think about that all your UI localizable terms should be stored in one central location. I mean, do not put some in resource file and some other in Database. Like you define labels on resource files and grid headers in database!! or maybe error or information messages. Just build it right from the beginning and define one central location.

More...

Master\Detail with CollapsiblePanelExtender and edit detail with HoverMenuExtender using GridView

by mosessaur| 08 September 2008| 10 Comments

Last year, Matt posted a cool post about . Last month I got an e-mail from Justin Riggs, he was trying to combine to things. The usage of HoverMenuExtender as described in Matt's post, and the I posted about few months ago.

He already made the sample which ease the job for me in this post, but he had and issue that the functionality wasn't work properly. So I fixed that and thought to share it here in case anyone would love to apply same feature. You can view demo here.

It is a must that you return to by Matt, and Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel by me before you go a head in this post.

screen01 screen02

More...

WSS 3.0 and MOSS 2007 Software Development Kits

by mosessaur| 06 September 2008| 1 Comments

Available for download, both WSS 3.0 SDK and MOSS 2007 SDK Updates. I really love MS Download notifications

Windows SharePoint Services 3.0: Software Development Kit (SDK)
The Windows SharePoint Services 3.0 software development kit (SDK) contains conceptual overviews, programming tasks, samples, and references to guide you in developing solutions based on Microsoft Windows SharePoint Services 3.0. Read more and download here. Or You can also view the Windows SharePoint Services 3.0 SDK online in the MSDN Library.

SharePoint Server 2007 SDK: Software Development Kit
The Microsoft Office SharePoint Server 2007 SDK contains conceptual overviews, “How Do I…?” programming tasks, developer tools, code samples, references, and an Enterprise Content Management (ECM) starter kit to guide you in developing solutions based on Microsoft Office SharePoint Server 2007. Read more and download here. Or you can also view the Microsoft Office SharePoint Server 2007 SDK in the MSDN Library.