asp.net web api2 - Returning varying models From Rest Endpoint -


background

I have my first webpage for some products, 2 comfort interfaces Developing / batches / packs etc. I read this how to make a good rest API and I got stuck on some concepts and my googling skills have failed me.

I would like to give developer options to prevent duplicated API hits for child / sub-processing data (i.e. return all packs with batch) I also like to embed or sideload sub resources Be able to specify which fields they want to return to.

I am used to making the method for a normal MVC / WebAP style and to create a self or shared view model and to send it completely if I need to send less data, I have a slimmore view Make modal.

Question

What type of return will I put on the rest of the last, this is just the one I requested (and the developer has to find out Based on what I can do to rely on documents, I have to build manually.

Or should I make a thick visual model and in some way, with the ability of the JSN / XML converter, to mark the fields optionally, if you do not accept these values, then tap the value etc. (but again How do I sub-source sub-resources ...)?

Thanks, Pete

I decided to use Odata V4 So that I can allow client-app to decide how and how to access the data I am showing. I do not support this sideloading (which I have searched so far) but it will not be easy for me Allows the model to embed, filter and slim.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -