From 51f5aea872bdbeb3240ad075de51cf87f87a9868 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Tue, 9 Dec 2025 17:06:38 +0330 Subject: [PATCH] last works ... --- Controllers/XTagServiceControllerBase.cs | 40 ++++++++++----------- Interfaces/IXTagServiceControllerActions.cs | 40 +++++++++++++++------ 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/Controllers/XTagServiceControllerBase.cs b/Controllers/XTagServiceControllerBase.cs index 3dd2bba..7ed8d11 100644 --- a/Controllers/XTagServiceControllerBase.cs +++ b/Controllers/XTagServiceControllerBase.cs @@ -54,8 +54,8 @@ namespace xTagService.Controllers /// /// /// - [HttpPost("Add")] - public async Task> Add( + [HttpPost("")] + public virtual async Task> Add( [FromBody] XTagDto model ) { @@ -94,9 +94,9 @@ namespace xTagService.Controllers /// /// /// - [HttpPut("Update")] - public async Task> Update( - [FromQuery] int id, + [HttpPut("{id}")] + public virtual async Task> Update( + [FromRoute] int id, [FromBody] XTagDto model ) { @@ -135,9 +135,9 @@ namespace xTagService.Controllers /// /// /// - [HttpDelete("Remove")] - public async Task> Remove( - [FromQuery] int id + [HttpDelete("{id}")] + public virtual async Task> Remove( + [FromRoute] int id ) { // @@ -174,9 +174,9 @@ namespace xTagService.Controllers /// /// /// - [HttpGet("")] - public async Task> Get( - [FromQuery] int id + [HttpGet("{id}")] + public virtual async Task> Get( + [FromRoute] int id ) { // @@ -206,7 +206,7 @@ namespace xTagService.Controllers /// /// [HttpGet("GetTag")] - public async Task> GetTag( + public virtual async Task> GetTag( [FromQuery] string tag ) { @@ -236,7 +236,7 @@ namespace xTagService.Controllers /// /// [HttpGet("All")] - public async Task>> GetAll() + public virtual async Task>> GetAll() { // // Do ... @@ -263,7 +263,7 @@ namespace xTagService.Controllers /// /// [HttpGet("FindOne")] - public async Task> FindOne( + public virtual async Task> FindOne( [FromQuery] string query ) { @@ -298,7 +298,7 @@ namespace xTagService.Controllers /// /// [HttpGet("FindMany")] - public async Task>> FindMany( + public virtual async Task>> FindMany( [FromQuery] string query ) { @@ -333,7 +333,7 @@ namespace xTagService.Controllers /// /// [HttpGet("Query")] - public async Task>> Query( + public virtual async Task>> Query( [FromQuery] XQuery query ) { @@ -362,7 +362,7 @@ namespace xTagService.Controllers /// /// [HttpGet("Count")] - public async Task> Count() + public virtual async Task> Count() { // // Do ... @@ -389,8 +389,8 @@ namespace xTagService.Controllers /// /// /// - [HttpGet("IsExists")] - public async Task> IsExists( + [HttpGet("{id}/IsExists")] + public virtual async Task> IsExists( [FromRoute] int id ) { @@ -420,7 +420,7 @@ namespace xTagService.Controllers /// /// [HttpGet("IsTagExists")] - public async Task> IsTagExists( + public virtual async Task> IsTagExists( [FromQuery] string tag ) { diff --git a/Interfaces/IXTagServiceControllerActions.cs b/Interfaces/IXTagServiceControllerActions.cs index ac20db3..e61a75e 100644 --- a/Interfaces/IXTagServiceControllerActions.cs +++ b/Interfaces/IXTagServiceControllerActions.cs @@ -15,21 +15,27 @@ namespace xTagService.Interfaces /// /// /// - Task> Add(XTagDto model); + Task> Add( + [FromBody] XTagDto model + ); /// /// Retrieve Specified Tag Dto by ID ... /// /// /// - Task> Get(int id); + Task> Get( + [FromRoute ]int id + ); /// /// Retrieve Specified Tag Dto by it's Label ... /// /// /// - Task> GetTag(string tag); + Task> GetTag( + [FromQuery] string tag + ); /// /// Retrieve All Exists Tags ... @@ -42,21 +48,27 @@ namespace xTagService.Interfaces /// /// /// - Task> FindOne(string query); + Task> FindOne( + [FromQuery] string query + ); /// /// Search For Specified Tags By Providing Query on Labels ... /// /// /// - Task>> FindMany(string query); + Task>> FindMany( + [FromQuery] string query + ); /// /// Retrieve Tags based on Query Model ... /// /// /// - Task>> Query(XQuery query); + Task>> Query( + [FromQuery] XQuery query + ); /// /// Update Specified Tag ... @@ -65,8 +77,8 @@ namespace xTagService.Interfaces /// /// Task> Update( - int id, - XTagDto model + [FromRoute] int id, + [FromBody] XTagDto model ); /// @@ -74,7 +86,9 @@ namespace xTagService.Interfaces /// /// /// - Task> Remove(int id); + Task> Remove( + [FromRoute] int id + ); /// /// Count Exists Tags ... @@ -87,14 +101,18 @@ namespace xTagService.Interfaces /// /// /// - Task> IsExists(int id); + Task> IsExists( + [FromRoute] int id + ); /// /// Check Tag Exists by Providing Label ... /// /// /// - Task> IsTagExists(string tag); + Task> IsTagExists( + [FromQuery]string tag + ); #endregion } } \ No newline at end of file