Compare commits

..
10 Commits
Author SHA1 Message Date
saherelm fa57be5fa5 last ... 2026-07-26 21:20:48 +03:30
saherelm 0d4ec1125f last ... 2026-06-12 23:50:36 +03:30
saherelm 49960c201f Update Lang Version to 12 ... 2026-06-12 02:14:22 +03:30
saherelm 441d9f06a4 last ... 2026-05-27 16:10:55 +03:30
saherelm 08e70f5095 last ... 2026-05-22 20:25:39 +03:30
saherelm 1471163990 last ... 2026-05-04 00:39:16 +03:30
saherelm 7109ff501e refactor csproj ... 2026-04-14 16:34:20 +03:30
saherelm d8342e973d Apply Cleanup and Refactor some models ... 2025-11-04 18:11:31 +03:30
saherelm 65dd819fb8 last ... 2025-11-04 00:21:15 +03:30
saherelm 98f67a831a Add Support for XPersonDto ... 2025-11-03 18:15:19 +03:30
15 changed files with 94 additions and 117 deletions
+21
View File
@@ -0,0 +1,21 @@
namespace xModels.Base
{
/// <summary>
/// Base Entity Related Dto Class ...
/// </summary>
/// <typeparam name="TKey"></typeparam>
public abstract class XBaseEntityDto<TKey>
{
/// <summary>
/// Entity Id
/// </summary>
/// <value>entity unique id</value>
public TKey Id { get; set; }
/// <summary>
/// Provided Soft Delete Behaviour ...
/// </summary>
/// <value></value>
public bool Deleted { get; set; }
}
}
+7
View File
@@ -0,0 +1,7 @@
using System;
namespace xModels.Base
{
public class XBaseGuidIDEntityDto : XBaseEntityDto<Guid>
{ }
}
+5
View File
@@ -0,0 +1,5 @@
namespace xModels.Base
{
public class XBaseIntIDEntityDto : XBaseEntityDto<int>
{ }
}
+5
View File
@@ -0,0 +1,5 @@
namespace xModels.Base
{
public class XBaseLongIDEntity : XBaseEntity<long>
{ }
}
+5
View File
@@ -0,0 +1,5 @@
namespace xModels.Base
{
public class XBaseLongIDEntityDto : XBaseEntityDto<long>
{ }
}
+5
View File
@@ -0,0 +1,5 @@
namespace xModels.Base
{
public class XBaseStringIDEntityDto : XBaseEntityDto<string>
{ }
}
+7
View File
@@ -0,0 +1,7 @@
namespace xModels.Base
{
public class XBaseValueContainer<T>
{
public T Value { get; set; }
}
}
-14
View File
@@ -1,14 +0,0 @@
namespace xModels.Dtos {
/// <summary>
/// Request a Page of Data based on Cursor ...
/// this only be Used in GraphQL ...
/// </summary>
public class XPageRequest {
public int? First { get; set; }
public int? Last { get; set; }
public string After { get; set; } = "";
public string Before { get; set; } = "";
public string SortBy { get; set; } = "";
public bool DescendingSort { get; set; }
}
}
-16
View File
@@ -1,16 +0,0 @@
using System.Collections.Generic;
namespace xModels.Dtos {
/// <summary>
/// Result of a Requested Page of Data based on Cursor ...
/// this only be Used in GraphQL ...
/// </summary>
/// <typeparam name="T"></typeparam>
public class XPageResponse<T> {
public List<T> Nodes { get; set; }
public int TotalCount { get; set; }
public bool HasNextPage { get; set; }
public bool HasPreviousPage { get; set; }
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ namespace xModels.Dtos
/// Since in Many Cases we have to Retrieve Specified User's Minimal /// Since in Many Cases we have to Retrieve Specified User's Minimal
/// Infos for Handle Data Transfering, this Dto is Used ... /// Infos for Handle Data Transfering, this Dto is Used ...
/// </summary> /// </summary>
public class XPersoDto : XBaseDto public class XPersonDto : XBaseDto
{ {
public string Username { get; set; } public string Username { get; set; }
public string Firstname { get; set; } public string Firstname { get; set; }
+17
View File
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using xModels.Base;
namespace xModels.Dtos
{
public class XLocaleResourceDto : XBaseDto
{
public string Language { get; set; }
public string Value { get; set; }
}
public class XResourceDto : XBaseDto
{
public string Resource { get; set; }
public IEnumerable<XLocaleResourceDto> Locales { get; set; } = new HashSet<XLocaleResourceDto>();
}
}
-1
View File
@@ -1,4 +1,3 @@
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using xCommons.Extensions; using xCommons.Extensions;
-80
View File
@@ -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<TEntity, TKey>
where TEntity : XBaseEntity<TKey> {
//
#region Retrieve ...
Task<ActionResult<TEntity>> Get (
[FromRoute] TKey id, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false
);
Task<ActionResult<IEnumerable<TEntity>>> GetAll (
[FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false
);
Task<ActionResult<TEntity>> FindOne (
[FromRoute] string query, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false
);
Task<ActionResult<IEnumerable<TEntity>>> FindMany (
[FromRoute] string query, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false
);
Task<ActionResult<XQueryResult<TEntity>>> Query (
[FromQuery] XQuery query, [FromQuery] bool ignoreSoftDeleteds = true
);
//
// TODO: Fix this ...
// Task<ActionResult<XPageResponse<TEntity>>> RequestPage (
// [FromQuery] XPageRequest request, [FromQuery] bool ignoreSoftDeleteds = true, [FromQuery] bool containsDetail = false
// );
#endregion
//
#region Add ...
Task<ActionResult<TEntity>> Add (TEntity item);
Task<ActionResult<TEntity>> AddOrUpdate (TEntity item);
Task<ActionResult> AddMany (XBaseRangeRequest<TEntity> request);
#endregion
//
#region Update ...
Task<ActionResult<TEntity>> Update (
[FromRoute] TKey id, [FromBody] TEntity item
);
Task<ActionResult<bool>> UpdateMany (
XBaseRangeRequest<TEntity> request
);
#endregion
//
#region Exists ...
Task<ActionResult<bool>> IsExists (
[FromRoute] TKey id,
bool ignoreSoftDeletedss = true
);
#endregion
//
#region Remove ...
Task<ActionResult<TEntity>> Remove (
[FromRoute] TKey id,
bool softDelete = true
);
Task<ActionResult> RemoveMany (
XBaseRangeRequest<TEntity> request,
bool softDelete = true
);
#endregion
}
}
+2 -1
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<packageSources> <packageSources>
<!-- <add key="megan" value="https://hub.megan.ir/nuget/index.json" /> -->
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> <add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="liget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" /> <add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" disableTLSCertificateValidation="true" />
</packageSources> </packageSources>
</configuration> </configuration>
+19 -4
View File
@@ -1,11 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<!-- Runtime Definition --> <!-- Runtime Definition -->
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>xDashboard.xModels</PackageId>
<Version>1.0.0</Version> <Version>1.0.0</Version>
<LangVersion>12.0</LangVersion>
<Authors>Hadi Khazaee Asl</Authors> <Authors>Hadi Khazaee Asl</Authors>
<Company>SaherElm IT Center</Company> <Company>SaherElm IT Center</Company>
<PackageId>xDashboard.xModels</PackageId>
<TargetFramework>netstandard2.0</TargetFramework>
<Description> <Description>
provide required models and related tools for using in xDashboard project. provide required models and related tools for using in xDashboard project.
</Description> </Description>
@@ -16,12 +19,24 @@
<!-- Icon Handling --> <!-- Icon Handling -->
<ItemGroup> <ItemGroup>
<None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true" PackagePath="\icon.png" /> <None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true"
PackagePath="\icon.png" />
</ItemGroup> </ItemGroup>
<!-- Local Modules --> <!-- Local Modules -->
<ItemGroup> <ItemGroup>
<!-- <PackageReference Include="xDashboard.xCommons" Version="1.0.0" /> --> </ItemGroup>
<!-- Local Dependencies -->
<ItemGroup>
<ProjectReference Include="../xCommons/xCommons.csproj" /> <ProjectReference Include="../xCommons/xCommons.csproj" />
</ItemGroup> </ItemGroup>
<!-- For XML Documentation Support -->
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
</Project> </Project>