I have 2 entities (Orders and Products) I expose as OData with ODataModelBuilder. In Order entity, there's a Status complex type. Is there a way to expose Status complex type?
ODataModelBuilder _modelBuilder = new ODataModelBuilder();
var _status = _modelBuilder.ComplexType<Status>();
_status.Property(x => x.Description);
_status.Property(x => x.Name);
_status.Property(x => x.StatusId);
var _order = _orders.EntityType;
_order.HasKey(x => x.OrderId);
_order.Property(x => x.ProductId);
_order.Property(x => x.Quantity);
_order.ComplexProperty(x => x.Status);
var _product = _products.EntityType;
_product.HasKey(x => x.ProductId);
_product.Property(x => x.Name);
_product.Property(x => x.Description);
Another way I could think of is to convert Status to EntityType. However, with this approach I can't define Status ComplexProperty in Order entity type, thus, removing Status property from Order type. The Order entity type must have Status.
Has anybody come across this problem before with OData in Web API ?