Custom Stream Entity
Applies To:# OData WebApi v7 for aspnet webapi supported OData AspNet WebApi V7# OData Webapi for Webapi supported OData AspNet WebApi V6
Since Web API OData V5.7, it supports to customize entity as stream.
Fluent API
Users can call fluent API to configure the stream entity. For example,
var builder = new ODataModelBuilder();
builder.EntityType<Vehicle>().MediaType();
...
IEdmModel model = builder.GetEdmModel();
Convention model builder
Users can put [MediaType] attribute on a CLR class to configure the stream entity. For example,
[MediaType]
public class Vehicle
{
[Key]
public int Id {get;set;}
...
}
var builder = new ODataConventionModelBuilder();
builder.EntityType<Vehicle>();
IEdmModel model = builder.GetEdmModel();
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for