I want to do something like SO does with DisplayName. When someone does not enter a DisplayName, I want to default this to 'User' + UserId. So the first user who signs up would get User1
- since UserId will be 1, the second User2
- since UserId will be 2, and so on.
The easiest way I can think of doing this is using a trigger, but I don't like triggers. I could save the user, then update the user after the save (basically a trigger, but done in my code). Any other ideas on how I can handle this? Is there a way I can set the default value on the column in the database?
I am using Asp.Net MVC 2, C# 4, EF4, and SQL Server 2008.