SubSonic-3.0-Templates icon indicating copy to clipboard operation
SubSonic-3.0-Templates copied to clipboard

sqlite t4 generation fails on table with compound key

Open PaulS opened this issue 15 years ago • 2 comments

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

PaulS avatar Dec 02 '09 08:12 PaulS

Make the key name an array everywhere?

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

    public Column[] PK{
        get{
           ...
        }
    }

PaulS avatar Dec 02 '09 09:12 PaulS

Or put a band-aid on it like this:

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

PaulS avatar Dec 02 '09 09:12 PaulS