Question: This question is related but not the same as this: [How do you give a C# Auto-Property a default value?](https://stackoverflow.com/questions/40730/how-do-you-give-a-c-auto-property-a-default-value)

I love auto-properties, but sometimes I have to do something like this:

```
private string someName;

public string SomeName
{
    get
    {
       return someName;
    }

    set
    {
        someName = value.Trim();
    }
}

```

If I have to do the same thing many times, I start wishing that I did not need to type so many lines/characters of code. I want to be able to intercept the value and change it sort of like so:

```
public string Somename
{
    get;

    [Trim]
    set;
}

```

Is there a way to do something like this? Would it be stupid? Is there a better way? Any other general comments? I admit, the example I gave is a bit hypothetical and I cannot locate the exact code now which made me think of this.

Thanks.

Answer: 
In regards to the Pink/P!nk situation, if that's a big deal to you, then yes, normalization would be useful.

Your songs table would reference an artist\_id.

You'd also have a table of artist aliases, which would map the various names that a particular artist has gone by to that artist\_id.

But this can get pretty complex, and technically, it may not even be correct in your situation, as if an artist chooses to release projects under different names, they may not want them all lumped together. 

In general, normalized databases are a safe place to start, but there are plenty of good reasons to denormalize, and it is more important to understand those reasons then blindly always do things one way.
So the subject you're asking about is called "Normalization" and while this is useful in many circumstances, it can't always be applied.

Consider the artist Pink. Some of her albums have her name as `Pink` and others `P!nk` which we recognize as the same visually, because we know it's her. But a database would by force see these two separately (which also makes searching for her songs harder, but that's another story). Also consider Prince, "The artist formally known as Prince", etc.

So it might be possible to have an artist `ID` that matches to both `Pink` and `P!nk` but that also matches to her albums `Funhouse` etc. (I'm really gonna stop with the examples now, as any more examples will need to be tabular).

So, I think the question becomes, how complex do you want your searching to be? As is, you're able to maintain a 1:1 correlation between tag and database info. It just depends how fancy you want things to be. Also, for the lookup I mentioned above, consider that most times that information is coming from the user, you really can't supply a lookup from P!nk to Pink any more than you would from Elephant to Pachyderm because you don't know what people are going to want to enter.

I think in this case, the naive approach is just as well.