0

I am able to ignore the property like below in webapiconfig.cs file for get method.

builder.EntitySet<Table1>("Table1").EntityType.Ignore(e => e.ABC); builder.EntitySet<Table1>("Table1").EntityType.Ignore(e => e.DEF);

but I don't want to ignore the above property for PUT/POST operation.

how to acheive this? Is there any way to dynamically do this as per GET/PUT/POST operation request?

I am working with OData web API.

2
  • 1
    Yes, use a DTO for the get operation. Jun 19, 2016 at 20:48
  • i am using DTO for get, but that is not OData Complaince. means its not giving the child data for $expand query.
    – Piyush
    Jun 22, 2016 at 6:46

1 Answer 1

0

Yes, Using Data Transfer Objects (DTOs) we can achieve this.

Please refer the below web page.

Here we have the examples

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.