I'm using DBLinq and DBMetal.exe to generate Linq-to-SQL like classes off an SQLite database. Every time I use DBMetal to regenerate my DataContext, it generates a class for sqlite_sequence. The trouble is is that sqlite_sequence isn't a proper table, so the class isn't complete.
The question is, can DBMetal.exe do a better job of generating this class, or can I tell DBMetal to ignore that class?
Thanks!
Here's my DBMetal.exe call
.\DbMetal.exe /namespace:Namespace /provider:SQLite "/conn:Data Source=Datasource.db" /code:CodeFile.cs
Here's the actual generated SQL for sqlite_sequence (which is a system table):
CREATE TABLE sqlite_sequence(name,seq)
Here's the broken class that gets generated (notice the properties, name and seq, which don't have data types. That is the problem):
[Table(Name = "main.sqlite_sequence")]
public partial class SQLiteSequence : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
private _name;
[DebuggerNonUserCode]
[Column(Storage = "_name", Name = "name", DbType = "")]
public Name
{
get
{
return _name;
}
set
{
if (value != _name)
{
_name = value;
OnPropertyChanged("Name");
}
}
}
private _seq;
[DebuggerNonUserCode]
[Column(Storage = "_seq", Name = "seq", DbType = "")]
public SEQ
{
get
{
return _seq;
}
set
{
if (value != _seq)
{
_seq = value;
OnPropertyChanged("SEQ");
}
}
}
public SQLiteSequence() {}
}