Default Values

Posts   
 
    
Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 29-Oct-2008 10:53:50   

Hi,

I don't know if it's a bug or not but the behaviour changed so I post here. Previously (v1.2005 + net 1.1) this nunit was ok :


        [Test]
        public void TestDefaultValueForPKFieldForNewEntity()                    
        {
            Timetable tt = new Timetable();
            Assert.AreEqual(0, tt.TtId);
            Assert.AreEqual(0, ((IEntityField2)tt.Fields.PrimaryKeyFields[0]).CurrentValue);
        }

Now, it breaks, because the CurrentValue is null.

Is it a bug or it's normal ? Because I've webservice that are in charge of giving new object (so that in the client the form fields are filled with server default value) by translating the object into dataset (using my own method) and now it crash because it didn't test the PK CurrentValue as it was always filled...

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 29-Oct-2008 14:08:26   

By design, in v2 CurrentValue doesn't get set to a default value anymore, it's always null in new entities. This made things performing better and have a lower memory footprint.