Creation of additional end point based on another column #2458
Unanswered
baskarkanini
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
HI Team,
This is my table and used the DAB CLI commands for this.
dab add Pets --source "[home].[Pets]"--source.type "table" --source.key-fields "PetId" --permissions "anonymous:*"
CREATE TABLE [home].[Pets](
[PetId] [int] IDENTITY(1,1) NOT NULL,
[PersonId] [int] NOT NULL,
[IsOwner] [bit] NOT NULL,
[HouseId] [int] NULL,
[PetName] nvarchar NULL,
[PetType] nvarchar NULL,
[PetBreed] nvarchar NULL,
[CreatedDate] [datetime] NULL,
[CreatedBy] nvarchar NULL,
[ModifiedDate] [datetime] NULL,
[ModifiedBy] nvarchar NULL,
[IsActive] [bit] NULL)
This is working fine. I dont have any issue.
I got get, getbyid, put, post, patch and delete.
https://localhost:5001/api/Pets/PetId/3
The problem:
GetByPetID. Similar to this how can i create another endpoint for get by housed.
eventhough this is not a primary key.
Please help me with the DAB command.
My alternate option would be stored procedure. But i prefer the CLI command which will solve my problem.
Thank you for your time and responses.
Beta Was this translation helpful? Give feedback.
All reactions