Thursday, April 07, 2011 7:33 PM
I have just encountered this issue, thought might share with you guys.
Auto increment Int Identity columns in SQL SERVER (EXPRESS), starts from value "0". When we create a new record in LS Screen (by pressing "+" button), also assigns value '0' by default, temporarily. And its the real value when the record originally saved.
However, if we delete that temporary record, or just by pressing "+" button and cancel it, LS actually pass the parameter value "0" to entity, and guess what...??!! All my existing records with "0" values are automatically get deleted.
WAIT. Things gets even worse. Now
1. Lets create one Product [Product1] [LS assigns value 0]
2. Add Few Orders Details [LS Refers value 0 for this particular product1]. DO NOT SAVE.
3. Create another Product [Product2] [Even for this product, LS assigns value 0]
4. Add Few Order Details to this second product [LS Refers 0 to this product2 too]
5. Delete Product2. LS deletes Product2 and Product2's related Orders.
6. Now take a look at Product1's Order Details. You won't see any.
LS TEAM : Why don't you assign a incremental negative value as default and pass it, if one of your existing product (SQL SERVER) assigns a value starting value from 0 or assigning the same value 0 over and over for all new records???
Plz correct me, if its already been addressed or my understanding is wrong.
Thursday, April 07, 2011 10:56 PM
Thanks for the detailed repro steps Bala.
We are able to reproduce your issue and are investigating it.
-Ed Smith (Visual Studio LightSwitch team)