Prefixing ID columns with the table name in Entity Framework

Posted by: Imar Spaanjaars at Wednesday, January 08, 2014 9:22:48 AM in: .NET General
I recently got a question about the database configuration part of my article series on N-Layer design in ASP.NET. In my model, all classes inherit DomainEntity<T> that defines a primary key called Id. This in turn means all primary key columns in the database are called Id as well. The reader wanted to know if it was possible to prefix that column with the entity / table name. So, the Id column in the People table would be called PersonId, the Id in EmailAddress would be called EmailAddressId and so on. This has always been possible (and easy to do) for separate entities, but EF 6's custom conventions makes it a lot easier to do it for the entire model.
Read on ...

Fixing Issues with HTML Help Workshop

Posted by: Imar Spaanjaars at Sunday, November 29, 2009 12:23:34 PM in: .NET General
I am working on an application that ships with documentation in the form of a Windows Compiled Help file. To build the help file I use Sandcastle and the excellent Sandcastle Help File Builder. Building the help file is part of a continuous integration plan so the help file is always up to date.
Read on ...

Building a Simple Rating Control for ASP.NET 2.0

Posted by: Imar Spaanjaars at Wednesday, December 06, 2006 12:21:34 PM in: .NET General

UPDATE: 16-7-2008 I have updated the control and wrote a new article about it. This new release fixes a few bugs and comes with a better sample web site to try out the control. Check out the new article here.



To show visitors of your site how other visitors feel about the content you're presenting on your site, it's good idea to let your visitors rate your content.

Many web sites take this approach. For example, Amazon uses a 5 star rating approach to rate the articles they're selling. Microsoft's MSDN site uses a nine-bar graph to display the quality of their (technical) articles. My own site uses a five-bar graph to let users rate an article (in the left hand column). Since there are many uses for a rating feature, it makes sense to encapsulate the rating mechanism in a custom ASP.NET Server Control. This article shows you how to build such a control.

Read on ...

'Re'implementing Interface Implementations: VB.NET vs. C#

Posted by: Peter Lanoie at Wednesday, January 05, 2005 5:09:34 PM in: .NET General
Let's say we have an interface implemented on a class. We want to create a subclass derived from the super class and change the implementation . The difference between C# and VB.Net make this a little tricky. So let's take a look at how it's done.
Read on ...

Enhancing Design-Time Support in your Controls

Posted by: Imar Spaanjaars at Thursday, June 24, 2004 4:17:41 PM in: .NET General

Server controls allow a page developer to drag and drop a page together in no to time. Most of these controls come "out of the box" with ASP.NET like the TextBox, the Label, the DataGrid and many other controls. Changing the appearance and behavior of these controls is often as easy as visually setting a few properties in the properties grid for your design application, like Visual Studio .NET or the Web Matrix.. To make this process even easier, many properties can be expanded and collapsed in the property grid. By collapsing a property like the Font style, you end up with a shorter and much cleaner property list, making it easier to locate and change your properties.

Adding these collapsible properties to your own server controls is possible as well. This article will guide you through the process of creating a simple server control that exposes a collapsible property in the property grid of visual designers like Visual Studio.NET or the Web Matrix.

Read on ...

How Do I Insert 'Now Playing' Info to my Posts on P2P?

Posted by: Imar Spaanjaars at Monday, April 26, 2004 7:34:08 AM in: .NET General

Over the past few weeks, I received numerous e-mails from P2P contributors asking me how I was able to insert information in my signature at the Wrox P2P forum about the music I am listening to when I make the post. Some wondered if I had nothing to do at all, and had all the time in the world to insert this information manually. Others already had the idea I had automated this process and were interested in the technical solution of this, rather useless, feature.

In this article I'll explain where I got the idea for this automated signature, what techniques and concepts were involved, and where I found the information required to build the solution.

Read on ...

Howto Use Embedded Images in a Pocket PC Application

Posted by: Imar Spaanjaars at Monday, October 06, 2003 8:49:23 PM in: .NET General
Pocket PC applications, just like ordinary Windows applications, often use images for all kinds of purposes, like Toolbar buttons, backgrounds, or just to spice up the User Interface. If you want to be certain that the images you're going need are always present on the device, you can embed them in the assembly, so they are always available. This article will explore the steps you need to perform to embed the image in the assembly, and how to retrieve the image again at runtime.
Read on ... 1