aboutsummaryrefslogtreecommitdiff
path: root/Data/Models/Interfaces
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2020-12-11 14:35:39 +0200
committertranstrike <transtrike@gmail.com>2020-12-11 14:35:39 +0200
commit6a85255c78a448256fab68cd361983ffc85f2b03 (patch)
treee4b4c3071a59fecf120d8ebddb7d366bdc653628 /Data/Models/Interfaces
parenteb7c817329bcdd9eb520c6760bacf84d6f45f20d (diff)
downloadDevHive-6a85255c78a448256fab68cd361983ffc85f2b03.tar
DevHive-6a85255c78a448256fab68cd361983ffc85f2b03.tar.gz
DevHive-6a85255c78a448256fab68cd361983ffc85f2b03.zip
Renamed Models to Data
Diffstat (limited to 'Data/Models/Interfaces')
-rw-r--r--Data/Models/Interfaces/Database/IRepository.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Data/Models/Interfaces/Database/IRepository.cs b/Data/Models/Interfaces/Database/IRepository.cs
new file mode 100644
index 0000000..81a1a35
--- /dev/null
+++ b/Data/Models/Interfaces/Database/IRepository.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Data.Models.Interfaces.Database
+{
+ public interface IRepository<TEntity>
+ where TEntity : class
+ {
+ //Add Entity to database
+ Task AddAsync(TEntity entity);
+
+ //Return *count* instances of Entity from the database
+ IEnumerable<TEntity> Query(int count);
+
+ //Find entity by id
+ Task<TEntity> 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