When should I consider representing the primary-key ...?

Posted by JMSA on Stack Overflow See other posts from Stack Overflow or by JMSA
Published on 2010-03-08T08:29:46Z Indexed on 2010/03/12 6:07 UTC
Read the original article Hit count: 252

Filed under:
|

When should I consider representing the primary-key as classes?

Should we only represent primary keys as classes when a table uses composite-key?

For example:

public class PrimaryKey
    { ... ... ...}

Then

private PrimaryKey _parentID;
        public PrimaryKey ParentID
        {
            get { return _parentID; }
            set { _parentID = value; }
        }

And

public void Delete(PrimaryKey id)
        {...}

When should I consider storing data as comma-separated values in a column in a DB table rather than storing them in different columns?

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql