Environment: WPF,MVVM, Odata 2, EF6, MVC
Scenario:
Attempting to submit a master/detail payload as a single transaction via a Telerik QueryableDataServiceCollectionView. Payload consists of 1 master record and 12 related detail records for insert.
I have included the following code in WebApiConfig:
config.Routes.MapHttpBatchRoute(
routeName: "WebApiBatch",
routeTemplate: "api/$batch",
batchHandler: new DefaultHttpBatchHandler(GlobalConfiguration.DefaultServer));
and
config.Routes.MapODataRoute(
"odata",
"odata",
builder.GetEdmModel(),
batchHandler: new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));
Now on the Client side, I don't know how to tell the QueryableDataServiceCollectionView to transmit the payload as a single transaction when SubmitChanges() is called.
ViewModel Constructor:
this.odataScoreService = odataScoreService;
odataScoreService.Service.SaveChangesDefaultOptions = SaveChangesOptions.Batch;
ProjectPhaseScores = new QueryableDataServiceCollectionView<ProjectPhaseScore>(odataScoreService.Service, odataScoreService.Entity);
ProjectPhaseScores.Expand = "ScoreItems";
ProjectPhaseScores.LoadedData += OnLoadedScoreData;
ProjectPhaseScores.FilterDescriptors.Add(projectPhaseFilterDescriptor);
I am still very new to Visual Studio Development so any assistance would be greatly appreciated.
Scenario:
Attempting to submit a master/detail payload as a single transaction via a Telerik QueryableDataServiceCollectionView. Payload consists of 1 master record and 12 related detail records for insert.
I have included the following code in WebApiConfig:
config.Routes.MapHttpBatchRoute(
routeName: "WebApiBatch",
routeTemplate: "api/$batch",
batchHandler: new DefaultHttpBatchHandler(GlobalConfiguration.DefaultServer));
and
config.Routes.MapODataRoute(
"odata",
"odata",
builder.GetEdmModel(),
batchHandler: new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));
Now on the Client side, I don't know how to tell the QueryableDataServiceCollectionView to transmit the payload as a single transaction when SubmitChanges() is called.
ViewModel Constructor:
this.odataScoreService = odataScoreService;
odataScoreService.Service.SaveChangesDefaultOptions = SaveChangesOptions.Batch;
ProjectPhaseScores = new QueryableDataServiceCollectionView<ProjectPhaseScore>(odataScoreService.Service, odataScoreService.Entity);
ProjectPhaseScores.Expand = "ScoreItems";
ProjectPhaseScores.LoadedData += OnLoadedScoreData;
ProjectPhaseScores.FilterDescriptors.Add(projectPhaseFilterDescriptor);
I am still very new to Visual Studio Development so any assistance would be greatly appreciated.