[dblinq-bugs] Get "Sequence contains more than one matching element" error when repeating foreign key for two different columns

105 views
Skip to first unread message

DanM

unread,
May 3, 2010, 4:58:24 PM5/3/10
to DbLinq Bugs
--------------- Steps to reproduce ---------------

1. In SQLite, add these two tables to a database called "TestDb":

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)
);

2. Run this command in DOS command-line:

"C:\...\DbMetal.exe"
/provider:Sqlite
/conn:"Data Source = C:\...\TestDb.sqlite"
/code:"C:\...\TestModel.cs"
/namespace:TestProj.Models

--------------- Expected Result ---------------

Command runs with no errors.

--------------- Actual Result ---------------

Commands fails with this error:
DbMetal: Sequence contains more than one matching element

--------------- Discussion: ---------------

"REFERENCES Person(Id)" is repeated twice, but this makes perfect
sense (and works fine if I use SqlServer with SqlMetal). If I remove
the second REFERENCES clause, the error disappears.

--------------- System Specs: ---------------

Windows XP
Visual Studio 2008
SQLite

(Everything is updated to the latest service pack and version)

--
dblinq-bugs maillist - dblin...@googlegroups.com
http://groups.google.com/group/dblinq-bugs
Reply all
Reply to author
Forward
0 new messages