aboutsummaryrefslogtreecommitdiff
path: root/Models/Interfaces/Database
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2020-12-08 21:00:32 +0200
committertranstrike <transtrike@gmail.com>2020-12-08 21:00:32 +0200
commite5eeef589fa90d5e605617dcf11be91cfa9b39c5 (patch)
tree3ff164a7600a85b0356dbf80fa479d3676409f0d /Models/Interfaces/Database
parent2bcaa82e555100ffbcf6b23dd330e7bddd67cad6 (diff)
downloadDevHive-e5eeef589fa90d5e605617dcf11be91cfa9b39c5.tar
DevHive-e5eeef589fa90d5e605617dcf11be91cfa9b39c5.tar.gz
DevHive-e5eeef589fa90d5e605617dcf11be91cfa9b39c5.zip
Move Interfaces in Models project
Diffstat (limited to 'Models/Interfaces/Database')
-rw-r--r--Models/Interfaces/Database/IRepository.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Models/Interfaces/Database/IRepository.cs b/Models/Interfaces/Database/IRepository.cs
new file mode 100644
index 0000000..e38bb82
--- /dev/null
+++ b/Models/Interfaces/Database/IRepository.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace 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
+ Task<IAsyncEnumerable<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