aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Repositories/IRepository.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Data/Repositories/IRepository.cs')
-rw-r--r--src/DevHive.Data/Repositories/IRepository.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/DevHive.Data/Repositories/IRepository.cs b/src/DevHive.Data/Repositories/IRepository.cs
new file mode 100644
index 0000000..81a1a35
--- /dev/null
+++ b/src/DevHive.Data/Repositories/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