Hi,

I have a problem with Identity store generation pattern.
It seems doesn't work or maybe I'm doing something wrong.

I've made the table "students" and the fields "id" and "name" as the key
field as well as
the generator. The simple insert sql statement - "insert into students(name)
values('some_name')"
works fine.
Using Visual Studio I created Entity Model and have this code:

using (var context = new fb1Container())
            {
                var st = new STUDENT { FIRSTNAME = "some_name" };
                context.STUDENTS.AddObject(st);
                context.SaveChanges();
            }

After context.SaveChanges() has performed I'm getting the id = 0 in my
database table
and the generator doesn't change its value. The second call raise an
exception, because
I'm trying to insert id as 0 and it is already stored in the database.

Do you have any suggestion what's wrong here?
-- 
View this message in context: 
http://firebird.1100200.n4.nabble.com/Entity-Framework-autoincrement-problem-tp3167085p3167085.html
Sent from the firebird-net-provider mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to