41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System.Threading.Tasks;
|
|
|
|
namespace Novaloop.PaymoApi.Shared
|
|
{
|
|
public interface IBaseApi<TReturnType, TCreatType>
|
|
{
|
|
string ResourceUri { get; set; }
|
|
|
|
/// <summary>
|
|
/// Receive all entities
|
|
/// </summary>
|
|
Task<TReturnType> GetAll();
|
|
|
|
/// <summary>
|
|
/// Retrieve an existing entity
|
|
/// </summary>
|
|
/// <param name="entityId">id of the entity</param>
|
|
/// <returns></returns>
|
|
Task<TReturnType> Get(int entityId);
|
|
|
|
/// <summary>
|
|
/// Create a new entity
|
|
/// </summary>
|
|
Task<TReturnType> Create( TCreatType entity);
|
|
|
|
/// <summary>
|
|
/// Delete an entity
|
|
/// </summary>
|
|
/// <param name="entityId">id of the entity</param>
|
|
/// <returns></returns>
|
|
Task Delete(int entityId);
|
|
|
|
/// <summary>
|
|
/// Update an entity
|
|
/// </summary>
|
|
/// <param name="entity">entity information to update the entity with</param>
|
|
/// <param name="id">id of the entity to update</param>
|
|
/// <returns></returns>
|
|
Task Update( TCreatType entity, int id);
|
|
}
|
|
} |