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.
Users can call fluent API to configure the stream entity. For example,
var builder = new ODataModelBuilder();
builder.EntityType<Vehicle>().MediaType();
...
IEdmModel model = builder.GetEdmModel();
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();