Writing an LightSwitch HTML client, how to prevent Primary Key validation? -
today played little bit lightswitch in visualstudio 2012. i've following problem:
i have database created entityframework (code first) guids primary key on every table.
i used database data source lightswitch project.
now on creating new item lightswitch, of course want hide primary key user, generated database. unfortunately gui keeps validating field, if remove screen. can't save new item, because validation wants me enter value primary key field.
i think i'm not using totally uncommon setup, how solve simple problem?
i've tried pre-populate guid in created event on server side, if include field on screen, still empty...
i found created code isn't run until try , first insert entity (which won't ever reach due validation error)
the solution found (which isn't ideal) populate id javascript empty guid ("00000000-0000-0000-0000-000000000000")] , overwriting in entity_inserting(..)
it's not ideal client confused id on server different it's id.
supposedly, 1 should generate ids in database, haven't had luck that.
Comments
Post a Comment