last ...
This commit is contained in:
@@ -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>
|
||||||
|
{ }
|
||||||
|
}
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user