dbmetal

Why does DbMetal Generate Table Attribute with “main”?

一笑奈何 提交于 2019-12-20 05:16:14
问题 I'm a newbie with DBLink and Sqlite. When DbMetal generates Nortwind.cs (C#) it marks some methods with a Table attribute: [Table(Name="main.Categories")] // C# After I used DbMetal to create a Nortwind.vb (VB.Net) file, the test program aborted because there was no table named "main.Categories". However, when I removed "main.", it works: ' VB.Net <Table(Name:="Categories")> _ I'm just not understand why "main" is generated at all. Why does it work for C# but not for VB.Net? 回答1: DbMetal

Equal is not defined between type Nullable<Int32> and Int32

别来无恙 提交于 2019-12-20 04:23:28
问题 I am writing a boring application to manage patients and their clinic history. I used SQLite combined with DbLinq libraries and DbMetal code generation utility. Here are two classes from the genereated code extracted from the underlying database: [Table(Name="main.Patients")] public partial class Patient : System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged { private static System.ComponentModel.PropertyChangingEventArgs emptyChangingEventArgs = new

DbMetal chokes on repeated foreign key references in SQLite - any ideas?

为君一笑 提交于 2019-12-11 07:52:17
问题 I've been struggling to get DbMetal to process my SQLite database. I finally isolated the problem. It won't allow a table to have two foreign key references to the same column. For example, a SQLite database with these two tables will fail: CREATE TABLE Person ( Id INTEGER PRIMARY KEY, Name TEXT NOT NULL ); CREATE TABLE Match ( Id INTEGER PRIMARY KEY, WinnerPersonId INTEGER NOT NULL REFERENCES Person(Id), LoserPersonId INTEGER NOT NULL REFERENCES Person(Id) ); I get this error: DbMetal:

How to set the DataContext class name with DbMetal?

可紊 提交于 2019-11-29 16:31:58
DbLinq's DbMetal generates a Main class which inherits DataContext . I don't want it to be Main . How to change that? Rodrigo Hahn DbMetal will always generate a class called Main by default. However, you can use the --database option when generating the .dbml. Oops: found this here in SO: Why does DbMetal Generate Table Attribute with "main"? 来源: https://stackoverflow.com/questions/4878493/how-to-set-the-datacontext-class-name-with-dbmetal

How to set the DataContext class name with DbMetal?

寵の児 提交于 2019-11-28 11:33:43
问题 DbLinq's DbMetal generates a Main class which inherits DataContext . I don't want it to be Main . How to change that? 回答1: DbMetal will always generate a class called Main by default. However, you can use the --database option when generating the .dbml. Oops: found this here in SO: Why does DbMetal Generate Table Attribute with "main"? 来源: https://stackoverflow.com/questions/4878493/how-to-set-the-datacontext-class-name-with-dbmetal