aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Repositories/UserRepository.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2020-12-14 23:29:14 +0200
committertranstrike <transtrike@gmail.com>2020-12-14 23:29:14 +0200
commitdee2e37a4a8759108390c664e06bf147b8385cbf (patch)
treebd65fe5649731a55aa6f1d8b48d53d89032fb8be /src/DevHive.Data/Repositories/UserRepository.cs
parent1ccdefdac025b1b986ad2bd0bc3eda7505d6e7c3 (diff)
downloadDevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.tar
DevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.tar.gz
DevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.zip
Stabalized project for compilation. Next step after init architecture
Diffstat (limited to 'src/DevHive.Data/Repositories/UserRepository.cs')
-rw-r--r--src/DevHive.Data/Repositories/UserRepository.cs69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/DevHive.Data/Repositories/UserRepository.cs b/src/DevHive.Data/Repositories/UserRepository.cs
new file mode 100644
index 0000000..5bd9d97
--- /dev/null
+++ b/src/DevHive.Data/Repositories/UserRepository.cs
@@ -0,0 +1,69 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Data.Models.Interfaces.Database;
+using DevHive.Data.Models;
+
+namespace DevHive.Data.Repositories
+{
+ public class UserRepository : IRepository<User>
+ {
+ /* private readonly UserRepository<User> _dbRepository;
+
+ public UserRepository(DbContext context)
+ : base (context)
+ {
+ this._dbRepository = new DbRepository<User>(context);
+ }
+
+ public User FindByUsername(string username)
+ {
+ return this._dbRepository.DbSet
+ .FirstOrDefault(usr => usr.UserName == username);
+ }
+
+ public bool DoesUsernameExist(string username)
+ {
+ return this._dbRepository.DbSet
+ .Any(x => x.UserName == username);
+ }
+
+ public bool DoesUserExist(Guid id)
+ {
+ return this._dbRepository.DbSet
+ .Any(x => x.Id == id);
+ }
+
+ public bool HasThisUsername(Guid id, string username)
+ {
+ return this._dbRepository.DbSet
+ .Any(x => x.Id == id &&
+ x.UserName == username);
+ } */
+
+ public Task AddAsync(User entity)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public IEnumerable<User> Query(int count)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public Task<User> FindByIdAsync(object id)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public Task EditAsync(object id, User newEntity)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public Task DeleteAsync(object id)
+ {
+ throw new System.NotImplementedException();
+ }
+ }
+}