I'm trying to make sense of SnapDevelop's generated code. Right now for Sample Code = ModelStore where one action puzzles me.
[HttpPost("ModelStore")]
...
public ActionResult Update(IModelStoredepartment)
...
ModelStore has internal state like reference to DataContext and info on original/current data values. REST call can only transfer the public properties.
I can see the purpose of such function inside the server-side code, but not at part of the REST API. So, my questions are:
- Have I misunderstood this action completely?
- Any good example of how to use it when called via REST?
- If you want to pass list of departments in a REST call, why now simply use List
?
Server-side could then try to find each matching department to either update or insert depending on its PKEY value.
Any help greatly appreciated.
You are correct! In the server-side, we can use IModelStore to receive either PLAIN format (data only) or DataWindow/ModelStore format JSON (with both data and status in it). It's similar with .NET DataStore.
BTW: Appeon will focus on enhancing .NET DataStore and SqlModelMapper. ModelStore is not recommended for it is a compromise between .NET DataStore and SqlModelMapper, although it will still be available if you prefer to use it.
Regards,
Logan