subsonic / SubSonic-3.0-Templates

T4 Template Project for the peeps
http://subsonic.github.io/
105 stars 46 forks source link

sqlite t4 generation fails on table with compound key #39

Open PaulS opened 14 years ago

PaulS commented 14 years ago

http://stackoverflow.com/questions/1831577/subsonic-3-sqlite-t4-generation-fails-on-compound-key

PaulS commented 14 years ago

Make the key name an array everywhere?

    public string[] KeyName()
    {
        ...
    }

    public Column[] PK{
        get{
           ...
        }
    }
PaulS commented 14 years ago

Or put a band-aid on it like this:

    public Column PK{
        get{
            return this.Columns.FirstOrDefault(x=>x.IsPK) ?? this.Columns[0];
        }
    }