From 1471163990253411a03ede62548e32fdfd5695fe Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Mon, 4 May 2026 00:39:16 +0330 Subject: [PATCH] last ... --- Base/XBaseEntityDto.cs | 21 +++++++ Base/XBaseGuidIDEntityDto.cs | 7 +++ Base/XBaseIntIDEntityDto.cs | 5 ++ Base/XBaseLongIDEntity.cs | 5 ++ Base/XBaseLongIDEntityDto.cs | 5 ++ Base/XBaseStringIDEntityDto.cs | 5 ++ Interfaces/IXEntityControllerActions.cs | 80 ------------------------- 7 files changed, 48 insertions(+), 80 deletions(-) create mode 100644 Base/XBaseEntityDto.cs create mode 100644 Base/XBaseGuidIDEntityDto.cs create mode 100644 Base/XBaseIntIDEntityDto.cs create mode 100644 Base/XBaseLongIDEntity.cs create mode 100644 Base/XBaseLongIDEntityDto.cs create mode 100644 Base/XBaseStringIDEntityDto.cs delete mode 100644 Interfaces/IXEntityControllerActions.cs diff --git a/Base/XBaseEntityDto.cs b/Base/XBaseEntityDto.cs new file mode 100644 index 0000000..bf68e0d --- /dev/null +++ b/Base/XBaseEntityDto.cs @@ -0,0 +1,21 @@ +namespace xModels.Base +{ + /// + /// Base Entity Related Dto Class ... + /// + /// + public abstract class XBaseEntityDto + { + /// + /// Entity Id + /// + /// entity unique id + public TKey Id { get; set; } + + /// + /// Provided Soft Delete Behaviour ... + /// + /// + public bool Deleted { get; set; } + } +} \ No newline at end of file diff --git a/Base/XBaseGuidIDEntityDto.cs b/Base/XBaseGuidIDEntityDto.cs new file mode 100644 index 0000000..d571dcf --- /dev/null +++ b/Base/XBaseGuidIDEntityDto.cs @@ -0,0 +1,7 @@ +using System; + +namespace xModels.Base +{ + public class XBaseGuidIDEntityDto : XBaseEntityDto + { } +} \ No newline at end of file diff --git a/Base/XBaseIntIDEntityDto.cs b/Base/XBaseIntIDEntityDto.cs new file mode 100644 index 0000000..47fc75b --- /dev/null +++ b/Base/XBaseIntIDEntityDto.cs @@ -0,0 +1,5 @@ +namespace xModels.Base +{ + public class XBaseIntIDEntityDto : XBaseEntityDto + { } +} \ No newline at end of file diff --git a/Base/XBaseLongIDEntity.cs b/Base/XBaseLongIDEntity.cs new file mode 100644 index 0000000..7ac472d --- /dev/null +++ b/Base/XBaseLongIDEntity.cs @@ -0,0 +1,5 @@ +namespace xModels.Base +{ + public class XBaseLongIDEntity : XBaseEntity + { } +} \ No newline at end of file diff --git a/Base/XBaseLongIDEntityDto.cs b/Base/XBaseLongIDEntityDto.cs new file mode 100644 index 0000000..db8c039 --- /dev/null +++ b/Base/XBaseLongIDEntityDto.cs @@ -0,0 +1,5 @@ +namespace xModels.Base +{ + public class XBaseLongIDEntityDto : XBaseEntityDto + { } +} \ No newline at end of file diff --git a/Base/XBaseStringIDEntityDto.cs b/Base/XBaseStringIDEntityDto.cs new file mode 100644 index 0000000..0ae8631 --- /dev/null +++ b/Base/XBaseStringIDEntityDto.cs @@ -0,0 +1,5 @@ +namespace xModels.Base +{ + public class XBaseStringIDEntityDto : XBaseEntityDto + { } +} \ No newline at end of file diff --git a/Interfaces/IXEntityControllerActions.cs b/Interfaces/IXEntityControllerActions.cs deleted file mode 100644 index c72a409..0000000 --- a/Interfaces/IXEntityControllerActions.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using xModels.Base; -using xModels.Dtos; - -namespace xModels.Interfaces { - public interface IXEntityControllerActions - where TEntity : XBaseEntity { - // - #region Retrieve ... - Task> Get ( - [FromRoute] TKey id, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false - ); - - Task>> GetAll ( - [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false - ); - - Task> FindOne ( - [FromRoute] string query, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false - ); - - Task>> FindMany ( - [FromRoute] string query, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false - ); - - Task>> Query ( - [FromQuery] XQuery query, [FromQuery] bool ignoreSoftDeleteds = true - ); - - // - // TODO: Fix this ... - // Task>> RequestPage ( - // [FromQuery] XPageRequest request, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false - // ); - #endregion - - // - #region Add ... - Task> Add (TEntity item); - - Task> AddOrUpdate (TEntity item); - - Task AddMany (XBaseRangeRequest request); - #endregion - - // - #region Update ... - Task> Update ( - [FromRoute] TKey id, [FromBody] TEntity item - ); - - Task> UpdateMany ( - XBaseRangeRequest request - ); - #endregion - - // - #region Exists ... - Task> IsExists ( - [FromRoute] TKey id, - bool ignoreSoftDeletedss = true - ); - #endregion - - // - #region Remove ... - Task> Remove ( - [FromRoute] TKey id, - bool softDelete = true - ); - - Task RemoveMany ( - XBaseRangeRequest request, - bool softDelete = true - ); - #endregion - } -} \ No newline at end of file