none
Need help in designing web api 2

    Question

  • I need to do POC on Web API 2. We should able to get data only requested properties/columns from specific entities through web api 2.

    Tables:

    Table A

    Table B


     Columns:

    Entity: A {

    Acol1,

    Acol2,

    Acol3,

    Acol4,

    Acol5

    }

    Computed value: AComputed (Bcol4 + Bcol5),

    Entity:             B {

                    Bcol1

                    Bcol2

                    Bcol3

                    Bcol4

                    Bcol5

    }

     

     End Points:

    GET /A ( default: Acol1,Acol2,Acol3 ) - Get all default properties

    GET /A?fields=Acol1 - Get only one column Acol1 from entity A

    GET /A?fields=Acol1,B(Bcol1,Bcol2) - Get a column from A Entity and 2 columns from B Entity

    GET /A?fields=Acol1,AComputed - Get a column from Entity A and computed column (user does not if it part of the entity or computed column)

    GET /A?fields=B(BCol1) - Get only one column from Entity B

     

    Please let me know your best thoughts and ideas to do it a better way. Much appreciated your ideas and suggestions.

     

    Regards

    Prem Boyapati


    • Edited by boyapati Wednesday, May 11, 2016 3:26 PM
    Wednesday, May 11, 2016 3:17 PM

Answers

All replies

  • Hi  Prem Boyapati,

    Actually this forum is to discuss the VS IDE usage, since this issue is related to the web API 2.

    I suggest you post this issue to the web developing forum:

    http://forums.asp.net/37.aspx/1?C+

    Maybe the above forum would be better for you.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 12, 2016 5:26 AM
    Moderator
  • I figured out the solution by extending Newtonsoft.Json.Serialization.DefaultContractResolver. No need to land on another forum. 

    Thanks Jack for your reply.

    Regards

    Prem.

    Monday, May 16, 2016 8:24 PM
  • Hi Prem,

    Glad to know that you have resolved this issue, if so, would you please mark your reply as the answer? So it would be helpful for other members who meet the same issue as yours.

    Of course, if you meet any VS IDE issue in the future, welcome to our forum:)

    Have a nice day,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 17, 2016 3:07 AM
    Moderator