-----Ursprüngliche Nachricht-----

Thank you for your suggestions.

I try to describe our problem in more detail. 
We try to implement a generic Repository. See DemoCode here:
http://pastebin.com/sGpC9Spb
The Models, which use the Repository live in a different assembly and
namespace. In this namespace I don't want to have an reference to the sqlite
assembly, but I want to set the Property ID as primary key.

I can't use the approach with the sql statement directly, because I want to
generate the table from the models - or am I wrong?

Any ideas?

Thanks a lot!

Message: 2
Date: Tue, 1 Apr 2014 15:32:52 -0700
From: "Joe Mistachkin" <sql...@mistachkin.com>
To: "'General Discussion of SQLite Database'"
        <sqlite-users@sqlite.org>
Subject: Re: [sqlite] Primary Key without DataAnnotation for Windows
        Runtime
Message-ID: <1E0017A1E762402A8C35003835664031@LACHRYMOSE>
Content-Type: text/plain;       charset="us-ascii"


Benedikt Neuhold wrote:
>
> we are building an App for Windows 8 and want to use sqlite as local DB.
We
> want to separate our Models from our DB Engine. So we need a way to set
the
> Primary Key without DataAnnotation. Is there a way? 
> 

I'm trying to figure out if I'm understanding your question correctly.  For
now,
I'll assume you can modify the CREATE TABLE statement itself.  In that case,
you
can make use of the PRIMARY KEY clause on one of the column definitions,
such as:

        CREATE TABLE t1(x TEXT PRIMARY KEY, y TEXT);

--
Joe Mistachkin



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to