Guest_imported
New member
- Jan 1, 1970
- 0
OK...here's the scenario.
I've got a object called Product, which is a singular product that can be loaded, updated from a DB.
The Product ID is a read-only property, that is generated as of the last ID and should not be set by UI.
Now, the problem is that as well as all this, I want to, as the very first thing in the app, load ALL products from the DB into a collection class, and to do this, I need to (obviously) assign those ID's from the DB to the Product (singular) object.
Of course, I cannot do this being that i've set the ID property as read-only. So...if I set it writable, then I compromise the integrity of the object by allowing UI to set this.
What is a solution for this? Any ideas are helpful...
ta much,
MG
I've got a object called Product, which is a singular product that can be loaded, updated from a DB.
The Product ID is a read-only property, that is generated as of the last ID and should not be set by UI.
Now, the problem is that as well as all this, I want to, as the very first thing in the app, load ALL products from the DB into a collection class, and to do this, I need to (obviously) assign those ID's from the DB to the Product (singular) object.
Of course, I cannot do this being that i've set the ID property as read-only. So...if I set it writable, then I compromise the integrity of the object by allowing UI to set this.
What is a solution for this? Any ideas are helpful...
ta much,
MG