Compare commits
10
Commits
bcfe72f99c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa57be5fa5 | ||
|
|
0d4ec1125f | ||
|
|
49960c201f | ||
|
|
441d9f06a4 | ||
|
|
08e70f5095 | ||
|
|
1471163990 | ||
|
|
7109ff501e | ||
|
|
d8342e973d | ||
|
|
65dd819fb8 | ||
|
|
98f67a831a |
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using System;
|
||||
|
||||
namespace xModels.Base
|
||||
{
|
||||
public class XBaseGuidIDEntityDto : XBaseEntityDto<Guid>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace xModels.Base
|
||||
{
|
||||
public class XBaseIntIDEntityDto : XBaseEntityDto<int>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace xModels.Base
|
||||
{
|
||||
public class XBaseLongIDEntity : XBaseEntity<long>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace xModels.Base
|
||||
{
|
||||
public class XBaseLongIDEntityDto : XBaseEntityDto<long>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace xModels.Base
|
||||
{
|
||||
public class XBaseStringIDEntityDto : XBaseEntityDto<string>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace xModels.Base
|
||||
{
|
||||
public class XBaseValueContainer<T>
|
||||
{
|
||||
public T Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace xModels.Dtos
|
||||
/// Since in Many Cases we have to Retrieve Specified User's Minimal
|
||||
/// Infos for Handle Data Transfering, this Dto is Used ...
|
||||
/// </summary>
|
||||
public class XPersoDto : XBaseDto
|
||||
public class XPersonDto : XBaseDto
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Firstname { get; set; }
|
||||
@@ -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,4 +1,3 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using xCommons.Extensions;
|
||||
|
||||
@@ -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
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<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="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>
|
||||
</configuration>
|
||||
+19
-4
@@ -1,11 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!-- Runtime Definition -->
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<PackageId>xDashboard.xModels</PackageId>
|
||||
<Version>1.0.0</Version>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<Authors>Hadi Khazaee Asl</Authors>
|
||||
<Company>SaherElm IT Center</Company>
|
||||
<PackageId>xDashboard.xModels</PackageId>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
|
||||
<Description>
|
||||
provide required models and related tools for using in xDashboard project.
|
||||
</Description>
|
||||
@@ -16,12 +19,24 @@
|
||||
|
||||
<!-- Icon Handling -->
|
||||
<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>
|
||||
|
||||
<!-- Local Modules -->
|
||||
<ItemGroup>
|
||||
<!-- <PackageReference Include="xDashboard.xCommons" Version="1.0.0" /> -->
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Local Dependencies -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../xCommons/xCommons.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- For XML Documentation Support -->
|
||||
<PropertyGroup>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user