I'm trying to do a simple update (using PostgreSQL) of bool field and get this exception:

System.InvalidOperationException: Sequence contains no matching element

Source query: Query.All<user>().Where(user => user.Locked).Set(user => user.Locked, false).Update();

There is 1 locked and 1 unlocked user in the table. Select query works fine and returns 1 user. Locked filed definition: [Field(Nullable = false, DefaultValue = false)] public bool Locked { get; set; }

I tried to execute similar query on another entity type: Query.All<fileentry>().Where(file => file.Active).Set(file => file.Active, false).Update();

and get more interesting error from PostgreSQL: 2012-07-23 17:04:50 GST ОТМЕТКА: оператор: UPDATE "public"."Files" SET "Active" = ((FALSE)::bool) FROM "public"."Files"; 2012-07-23 17:04:50 GST ОШИБКА: имя таблицы "Files" указано больше одного раза

Looks like translaction to SQL is incorrect.

asked Jul 23 '12 at 09:32

Lucas's gravatar image

Lucas
15225

Hello Lucas,
I will check this soon. Could you clarify, what model of this entities and call stack of this exception?

(Jul 23 '12 at 10:17) proff proff's gravatar image

Unfortunately I can't reproduce first exception in another project. Here is the test project that demonstrates second exception: https://dl.dropbox.com/u/2969279/BulkTest.zip

(Jul 24 '12 at 05:29) Lucas Lucas's gravatar image

One Answer:

second error fixed and fix available from source in codeplex. It will be published to nuget soon.

answered Jul 30 '12 at 18:02

proff's gravatar image

proff
75336

edited Jul 30 '12 at 18:03

DataObjects.Net Extensions 4.5.3 is published, link

(Aug 06 '12 at 09:29) Dmitri Maximov Dmitri%20Maximov's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA