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: 
Your database is not normalized. You say it's all in one table, but you haven't given any information about the schema.

The kinds of problems which non-normalized databases have include problems with consistency related to storing redundant information - if you have something like:

Album, Track, Artist

then to change the Album name, you have to change it on every track associated with the Album.

Of course, there are all kinds of "database" systems out there which are not normalized, but these usually have mechanisms to handle these kinds of things which are appropriate to their paradigms.
pretty screwed, indeed. it's hardly normalized. go for separate tables. 

if you've never heard of normalization or understood why it was important, perhaps you should read [this](http://www.phlonx.com/resources/nf3/). it's a succinct, simple explanation without a lot of jargon.

or you could go straight to the source since you're already using mysql: 

<http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html>

think about the cardinalities and relationships in your model:

1. an album will have zero or more tracks; a track will belong to only one album (album-to-track is one to many)
2. an artist can create zero or more albums; an album can be created by one or more artists (artist-to-album is many-to-many)

you'll want to think carefully about indexes, primary, and foreign keys. add indexes to non-key columns or groups that you'll want to search on.

this design would have four tables: album, track, artist, and artist\_to\_album many to many join table.