80 lines
2.7 KiB
C#
80 lines
2.7 KiB
C#
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
|
|
}
|
|
} |