You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a DB entity that includes a lot of information for various kinds of orders. But when using the REST interface, I would like to filter the irrelevant data away from the API. My idea was to use interfaces to do this.
Example:
publicinterfaceIOrderBase{publicintId{get;set;}}publicinterfaceISalesOrder:IOrderBase{publicint?CustomerId{get;set;}}publicinterfaceIPurchaseOrder:IOrderBase{publicint?VendorId{get;set;}}publicclassOrderEntity:IPurchaseOrder,ISalesOrder{publicintId{get;set;}publicint?CustomerId{get;set;}publicint?VendorId{get;set;}}[HttpGet("{id}")][Route("purchaseOrder")]public IPurchaseOrder GetPurchaseOrder(intid){OrderEntitypurchaseOrder=// use entity framework to fetch record
return (IPurchaseOrder)purchaseOrder;}
Unfortunately, the API does not include OrderID in the PurchaseOrder.
From the schemas
I have a DB entity that includes a lot of information for various kinds of orders. But when using the REST interface, I would like to filter the irrelevant data away from the API. My idea was to use interfaces to do this.
Example:
Unfortunately, the API does not include
OrderID
in thePurchaseOrder
.From the schemas
I have
openApiConfiguration.SchemaSettings.FlattenInheritanceHierarchy = true;
inAddOpenApiDocument()
, but that does not work.The text was updated successfully, but these errors were encountered: