The template generates this code.
#region Factory Methods
private static int _newID = -1;
internal static T NewBuildingEC()
{
T child = DataPortal.Create<T>();
child._id = _newID--;
child.ValidationRules.CheckRules();
return child;
}
Where the _newID is created if the object has an Identity field. What is the purpose of the child._id = _newID--? Won't this simply always assign child._id a value of -2 since newID is defaulted to -1? Or am I reading this incorrectly?
Will
OK, but I was wondering why the negative ID values? Is this simply to keep them unique and also a value that the database would find invalid? Or is there some other reasoning.
P.S. on my other posts, not sure how I missed the XSD file in that directory. :( That would have saved me a LOT of time. :)
Thanks,
Will
Copyright (c) Marimer LLC