From 2bcaa82e555100ffbcf6b23dd330e7bddd67cad6 Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 8 Dec 2020 20:38:05 +0200 Subject: DbRepository implemented --- API/Database/Interfaces/IRepository.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 API/Database/Interfaces/IRepository.cs (limited to 'API/Database/Interfaces') diff --git a/API/Database/Interfaces/IRepository.cs b/API/Database/Interfaces/IRepository.cs new file mode 100644 index 0000000..927e006 --- /dev/null +++ b/API/Database/Interfaces/IRepository.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Camera_Shop.Database +{ + public interface IRepository + where TEntity : class + { + //Add Entity to database + Task AddAsync(TEntity entity); + + //Return *count* instances of Entity from the database + Task> Query(int count); + + //Find entity by id + Task FindByIdAsync(object id); + + //Modify Entity from database + Task EditAsync(object id, TEntity newEntity); + + //Delete Entity from database + Task DeleteAsync(object id); + } +} \ No newline at end of file -- cgit v1.2.3