4

Playing around with Upshot and the DbDataController all seems fine. I am wondering if Upshot is compatible with a normal ApiController?

e.g. An Api Controller Post method which takes a Model and then adds that model to an XML file in some way or another. The client posts the data with Upshot and still recieves the validation errors?

Has anyone else played around with Upshot to this extent?

Charles
  • 50,943
  • 13
  • 104
  • 142
MaxWillmott
  • 2,170
  • 2
  • 23
  • 34

2 Answers2

0

SPA is using upshot.js, a javascript framework that is tightly related with Entity Framework. So if you want to use the SPA features, you will need to use DataController & EF.

Paolo del Mundo
  • 2,121
  • 13
  • 18
0

You can inherit from DataController and it generally works okay - and it doesn't use EF from what I can see.

The only issue is that when you do updates you need to accept a ChangeSet as opposed to your entity - but you can poke around in the ChangeSet to find the affected Entities.

This is basically because when you submit changes it wraps it in additional information as opposed to simply submitting a JSON object with your Entity, or a collection of Entities.

You could create a custom data provider for Upshot to get around this though - although I haven't got around to creating that (yet). If I do I'll open source it, although I quite like receiving a ChangeSet because it actually has all the information regarding what has changed etc, so I'd be inclined to handle this server side unless data transfer/security (?) was an issue. Either way, nice to have that option.

sjhuk
  • 313
  • 2
  • 7