c# - How to prevent ODataConventionModelBuilder to automatically expose all derived types' metadata? -


I am using Odetta Confrensmodelbilder to ADM model for Web API Odata service like this:

  Odata ModelBuilder Builder = New Odata ConferenceModelBuilder (); Builder. Namespace = "x"; Builder. ContainerName = "Y"; Builder.EntitySet & LT; Z & gt; ("Z"); IEdmModel edmModel = Builder. GetEdmModel ();   

class Z is located in an assembly, and public class Q Z is located in separate assembly.

Odataconvenshnmodelbiilder ADM model will generate Q >) among other derived classes (and it will come with the service metadata It is undesirable in our case.

When there is such a problem in the inaccessible class (such as internally defined), it certainly does not exist.

What ODataConventionModelBuilder the

This should work:

  ODataConventionModelBuilder Builder = New ODataConventionModelBuilder (); Builder. Namespace = "x"; Builder. ContainerName = "Y"; builder.EntitySet ("Z"); builder.Ignore & LT; Q & gt; (); IEdmModel edmModel = Builder. GetEdmModel ();    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -