aboutsummaryrefslogtreecommitdiff
path: root/API
diff options
context:
space:
mode:
Diffstat (limited to 'API')
-rw-r--r--API/Database/DbRepository.cs3
-rw-r--r--API/Database/Interfaces/IRepository.cs24
2 files changed, 2 insertions, 25 deletions
diff --git a/API/Database/DbRepository.cs b/API/Database/DbRepository.cs
index 5540104..b961a54 100644
--- a/API/Database/DbRepository.cs
+++ b/API/Database/DbRepository.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using Camera_Shop.Database;
+using Models.Interfaces.Database;
using Microsoft.EntityFrameworkCore;
namespace API.Database
@@ -37,6 +37,7 @@ namespace API.Database
{
return this._context
.Set<TEntity>()
+ .AsNoTracking()
.Take(count)
.AsAsyncEnumerable();
}
diff --git a/API/Database/Interfaces/IRepository.cs b/API/Database/Interfaces/IRepository.cs
deleted file mode 100644
index 927e006..0000000
--- a/API/Database/Interfaces/IRepository.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Camera_Shop.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