jaystack / odata-v4-server

With JayStack OData v4 Server you can build your own data endpoints without the hassle of implementing any protocol-level code. This framework binds OData v4 requests to your annotated controller functions, and compiles OData v4 compatible response. Clients can access services through OData-compliant HTTP requests. We recommend the JayData library for consuming OData v4 APIs.
https://jaystack.com/products/jaystack-odata-v4-server/
75 stars 55 forks source link

Do you have an example to show how to self-reference the model #50

Open hanyoujia opened 4 years ago

hanyoujia commented 4 years ago

` @Edm.Annotate({ term: "UI.DisplayName", string: "Products" })

export class Product{ @Edm.Key @Edm.Computed @Edm.String @Edm.Convert(toObjectID) @Edm.Annotate({ term: "UI.DisplayName", string: "Product identifier" }, { term: "UI.ControlHint", string: "ReadOnly" }) _id:ObjectID @Edm.ForeignKey("Product") @Edm.EntityType(Edm.ForwardRef(() => Product)) @Edm.Partner("Product") Product:Product UnitPrice:number }

`