You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this is a good behaviour. This can lead to half-loaded business objects, where the business logic could fail just because the object is not fully loaded. Also this sould lead to some very subtle bugs. What are your use case? Could we solve the problem in another way?
It all made good sense when having a wide table (80+ columns) and wanted to select only 10 into a list.
That way you could use the "master" class with all properties and just map what you had selected.
I can see your point in "getting half-loaded" business objects.
The only option I can see otherwise, will be creating a semi-class of my master class - and deal with having multiple classes holding similar data.
If no-one else is in need of this - then please close the issue. I can work around it. :-)
Edit **
Come to think about it - again. A Controller (POST) receiving an object {"foo":"testdata","bar":"moretestdata"} is perfectly correct parsed into TBusinessObjectFooBar = class FID : integer; FFoo : string; FBar : string; end;
and that leads to half-loaded business objects too ... but I think that it should be up to the developer.
Let me know what you think.
delphimvcframework/sources/MVCFramework.DataSet.Utils.pas
Line 312 in a4381ec
Existing line does not allow data from a dataset where fields are "missing".
Change to this - to allow 'SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMER' to be used in object of TCustomer with more properties than ID and NAME.
if (not _dict.TryGetValue(_field.Name, field_name)) or (ADataSet.FindField(field_name) = nil) then
The text was updated successfully, but these errors were encountered: