furystack-core
FuryStack framework, core package.
Model declaration with @PrimaryKey, @Property and @ForeignKey decorators:
Accessing model metadata via Global ModelDescriptorStore, usage:
;/*descriptor.Object = {constructor: class MyModel { … }}descriptor.Entries = [PrimaryKeyDescriptorEntry {PrimaryKey: "Id"}ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyA", EdmType: 0}ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyB", EdmType: 0}ForeignKeyDescriptorEntry {ForeignKeyField: "RefExample", ReferenceName: "RefExample"}]descriptor..PrimaryKey = PrimaryKeyDescriptorEntry {PrimaryKey: "Id"}descriptor.Properties = [ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyA", EdmType: 0}ODataPropertyDesrciptorEntry {PropertyName: "MyPropertyB", EdmType: 0}]descriptor.ForeignKeys = [ForeignKeyDescriptorEntry {ForeignKeyField: "RefExample", ReferenceName: "RefExample"}]*/
Setup and endpoint with the EndpointBuilder class:
;builder.EntityTypeMyModel;builder.EntityTypeRefExample;builder.EntitySetMyModel, 'mymodels';