Skip to content

Commit

Permalink
add delete bulkd to v2 controller
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmoudalaskalany committed Nov 3, 2024
1 parent 603c353 commit 117fad6
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Template.Api/Controllers/V2/Identity/PermissionsController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading.Tasks;
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using Template.Api.Controllers.V1.Base;
Expand Down Expand Up @@ -115,6 +116,13 @@ public async Task<IFinalResult> DeleteSoftAsync(long id)
return await _service.DeleteSoftAsync(id);
}

/// <summary>
/// Bulk Remove by ids
/// </summary>
/// <param name="ids">PK</param>
/// <returns></returns>
[HttpDelete("deleteRange")]
public async Task<IFinalResult> DeleteRangeAsync(List<int> ids) => await _service.DeleteRangeAsync(ids);

}
}
9 changes: 9 additions & 0 deletions Template.Api/Controllers/V2/Identity/UsersController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -115,6 +116,14 @@ public async Task<IFinalResult> DeleteSoftAsync(Guid id)
return await _service.DeleteSoftAsync(id);
}

/// <summary>
/// Bulk Remove by ids
/// </summary>
/// <param name="ids">PK</param>
/// <returns></returns>
[HttpDelete("deleteRange")]
public async Task<IFinalResult> DeleteRangeAsync(List<Guid> ids) => await _service.DeleteRangeAsync(ids);


}
}
8 changes: 8 additions & 0 deletions Template.Api/Controllers/V2/Lookup/ActionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Template.Common.DTO.Base;
using Template.Common.DTO.Lookup.Action.Parameters;
using Template.Common.DTO.Lookup.Action;
using System.Collections.Generic;

namespace Template.Api.Controllers.V2.Lookup
{
Expand Down Expand Up @@ -94,6 +95,13 @@ public ActionsController(IActionService actionService)
[HttpDelete("deleteSoft/{id}")]
public async Task<IFinalResult> DeleteSoftAsync(int id) => await _actionService.DeleteSoftAsync(id);

/// <summary>
/// Bulk Remove by ids
/// </summary>
/// <param name="ids">PK</param>
/// <returns></returns>
[HttpDelete("deleteRange")]
public async Task<IFinalResult> DeleteRangeAsync(List<int> ids) => await _actionService.DeleteRangeAsync(ids);

}
}
10 changes: 9 additions & 1 deletion Template.Api/Controllers/V2/Lookup/CategoriesController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading.Tasks;
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using Template.Api.Controllers.V1.Base;
Expand Down Expand Up @@ -93,5 +94,12 @@ public CategoriesController(ICategoryService categoryService)
[HttpDelete("deleteSoft/{id}")]
public async Task<IFinalResult> DeleteSoftAsync(int id) => await _categoryService.DeleteSoftAsync(id);

/// <summary>
/// Bulk Remove by ids
/// </summary>
/// <param name="ids">PK</param>
/// <returns></returns>
[HttpDelete("deleteRange")]
public async Task<IFinalResult> DeleteRangeAsync(List<int> ids) => await _categoryService.DeleteRangeAsync(ids);
}
}
10 changes: 10 additions & 0 deletions Template.Api/Controllers/V2/Lookup/StatusesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Template.Common.DTO.Base;
using Template.Common.DTO.Lookup.Status.Parameters;
using Template.Common.DTO.Lookup.Status;
using System.Collections.Generic;

namespace Template.Api.Controllers.V2.Lookup
{
Expand Down Expand Up @@ -93,5 +94,14 @@ public StatusesController(IStatusService statusService)
/// <returns></returns>
[HttpDelete("deleteSoft/{id}")]
public async Task<IFinalResult> DeleteSoftAsync(int id) => await _statusService.DeleteSoftAsync(id);


/// <summary>
/// Bulk Remove by ids
/// </summary>
/// <param name="ids">PK</param>
/// <returns></returns>
[HttpDelete("deleteRange")]
public async Task<IFinalResult> DeleteRangeAsync(List<int> ids) => await _statusService.DeleteRangeAsync(ids);
}
}
35 changes: 35 additions & 0 deletions Template.Api/Template.Api.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 117fad6

Please sign in to comment.