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
Speaking about SaveProtected in #61 I think I can simplify the concept:
This is how it currently works:
Registering Save-like on an entity sets SaveProtected
The developer can override SaveProtected if he needs to.
At start time the framework checks that RequiresSaveProtected(EntityKind) == SaveProtected
Note: RequiresSaveProtected returns true for [String, Shared, Main] and false for [System, SystemString, Relational, Part, SharedPart].
But I've been illuminated with a simpler algorithm that maybe is easier to remember.
Registering an entity sets RequiresSave to CalculateRequiresSave(EntityKind) using the same logic.
The developer can override RequiresSave.
At start time the framework checks all the entities that have RequireSave==true having at least one Save-like operation registered.
For the vast majority of cases the change in behavior will be transparent, except than when you forget to register a save you'll get a simpler to understand error like
'YourEntityName' is 'Main' and requires a save operation but, none has been found. Consider one of the following options:
* Register a save operation for `YourEntityName` using `save` snippet.
* Change the EntityKind of `YourEntityName` to one that does not require save.
* Exceptionally, call 'OperationLogic.RequiresSave(typeof(YourEntityName), false)' to override the value.
Does this looks like a good idea?
The text was updated successfully, but these errors were encountered:
Speaking about
SaveProtected
in #61 I think I can simplify the concept:This is how it currently works:
SaveProtected
SaveProtected
if he needs to.RequiresSaveProtected(EntityKind) == SaveProtected
Note:
RequiresSaveProtected
returns true for[String, Shared, Main]
and false for[System, SystemString, Relational, Part, SharedPart]
.But I've been illuminated with a simpler algorithm that maybe is easier to remember.
RequiresSave
toCalculateRequiresSave(EntityKind)
using the same logic.RequiresSave
.RequireSave==true
having at least one Save-like operation registered.For the vast majority of cases the change in behavior will be transparent, except than when you forget to register a save you'll get a simpler to understand error like
Does this looks like a good idea?
The text was updated successfully, but these errors were encountered: