2014-03-04 34 views
0

我正在與微風js mvc。當我從特定的實體刪除某些記錄,當我發送數據給控制器,因爲我需要從JObject特定的刪除記錄和它的狀態。我有這樣獲取實體狀態saveChange在微風js

{ 
    "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": {} 
} 

我怎樣才能從這個JObject得到實體StageDetail和實體狀態一JObject。由於

回答

1

在控制器限定之前保存實體像下面

public bool BeforeSaveEntity(EntityInfo info) { } 它生病命中當過「保存更改」方法被調用,還有你從實體刪除記錄。

僅供參考經過以下幾個環節

Breeze before save entites