using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using xModels.Base;
using xModels.Dtos;
using xPushService.Base;
namespace xPushService.Interfaces
{
///
/// a Provided Controller Used for Providing a Provided Service Actions ...
///
///
///
///
///
public interface IXBaseProvidedController
where TEntity : XBaseEntity
where TDto : XBaseEntityDto
where THub : XBaseDtoHub
{
//
#region Retrieve ...
///
/// Get Specified Item by ID ...
///
///
///
///
///
[HttpGet("{id}")]
Task> Get(
[FromRoute] TKey id,
[FromQuery] bool useDefaultIncludes = false,
CancellationToken cancellationToken = default
);
///
/// Get All Exists Items ...
///
///
///
///
///
[HttpGet("")]
Task>> GetAll(
[FromQuery] bool useDefaultOrders = false,
[FromQuery] bool useDefaultIncludes = false,
CancellationToken cancellationToken = default
);
///
/// Find an item by providing a Conditional Expression ...
///
///
///
///
///
[HttpGet("Find/One")]
Task> FindOne(
[FromQuery] string query,
[FromQuery] bool useDefaultIncludes = false,
CancellationToken cancellationToken = default
);
///
/// Find a collection of Items by proving a Query Search ...
///
///
///
///
///
///
[HttpGet("Find/Many")]
Task>> FindMany(
[FromQuery] string query,
[FromQuery] bool useDefaultOrders = false,
[FromQuery] bool useDefaultIncludes = false,
CancellationToken cancellationToken = default
);
///
/// Retrieve Items based on XQuery Pagination structure ...
///
///
///
///
///
///
[HttpGet("Query")]
Task>> Query(
[FromQuery] XQuery query,
[FromQuery] bool useDefaultOrders = false,
[FromQuery] bool useDefaultIncludes = false,
CancellationToken cancellationToken = default
);
///
/// Retrieve Owned Items based on XQuery Pagination structure ...
///
///
///
///
///
///
[HttpGet("Query/Owned")]
Task>> QueryOwned(
[FromQuery] XQuery query,
[FromQuery] bool useDefaultOrders = false,
[FromQuery] bool useDefaultIncludes = false,
CancellationToken cancellationToken = default
);
#endregion
//
#region Add/Update/Remove ...
///
/// Add an item ...
///
///
///
///
[HttpPost("")]
Task> Add(
[FromBody] TDto item,
CancellationToken cancellationToken = default
);
///
/// Update an item values ...
///
///
///
///
///
[HttpPut("{id}")]
Task> Update(
[FromRoute] TKey id,
[FromBody] TDto item,
CancellationToken cancellationToken = default
);
///
/// Remove an Item ...
///
///
///
///
[HttpDelete("{id}")]
Task> Remove(
[FromRoute] TKey id,
CancellationToken cancellationToken = default
);
#endregion
}
}