Reputation: 3934
I am working with mvc with breeze js. when i delete some record from specific entity and when i send data to controller that for causes i need specificed deleted record and its state from JObject. I have a JObject like this
{
"entities": [
{
"StageDetailID": 7,
"EventID": 1,
"StageNUmber": "Stage 1",
"TypeOfStage": "Primary ",
"Distance": "100",
"IsRadioRoadMap": "N",
"IsRadioCourseApproval": "N",
"IsRadioTrafficControl": "N",
"IsRadioPoliceAssistance": "N",
"IsNeutralSupport": "N",
"IsKOMQOM": "N",
"IsSprints": "N",
"IsFeedStations": "N",
"IsRoadClosures": "N",
"IsDetours": "N",
"IsSpeedReductions": "N",
"entityAspect": {
"entityTypeName": "StageDetail:#EventManagement.Domain.Model",
"defaultResourceName": "StageDetails",
"entityState": "Deleted",
"originalValuesMap": {},
"autoGeneratedKey": {
"propertyName": "StageDetailID",
"autoGeneratedKeyType": "Identity"
}
}
}
],
"saveOptions": {}
}
How can i get the Entity StageDetail and Entity State from this JObject. Thanks
Upvotes: 0
Views: 352
Reputation:
In your controller define before save entity like below
public bool BeforeSaveEntity(EntityInfo info)
{
}
and it ill hit when ever "Save changes" method is invoked, there you delete records from your entity.
For reference go through the following link
Upvotes: 1