DbGovor init

This commit is contained in:
Artemy
2025-06-16 22:31:45 +07:00
parent c7c778ceb1
commit d62c38db51
25 changed files with 613 additions and 36 deletions
+10
View File
@@ -0,0 +1,10 @@
using Govor.Core.Models;
namespace Govor.Core.Repositories;
public interface IUsersExist
{
public Task<bool> Exists(User user);
public Task<bool> ExistsById(Guid id);
public Task<bool> ExistsUsername(string username);
}
+14
View File
@@ -0,0 +1,14 @@
using Govor.Core.Models;
namespace Govor.Core.Repositories;
public interface IUsersReader
{
public Task<IEnumerable<User>> GetAll();
public Task<User> FindById(Guid id);
public Task<IEnumerable<User>> FindByRangeId(IEnumerable<Guid> ids);
public Task<User> FindByUsername(string username);
public Task<IEnumerable<User>> FindByRangeUsername(IEnumerable<string> usernames);
public Task<IEnumerable<User>> FindUsersByCreatedDate(DateOnly createdDate);
}
@@ -0,0 +1,6 @@
namespace Govor.Core.Repositories;
public interface IUsersRepository : IUsersReader, IUsersWriter, IUsersExist
{
}
+11
View File
@@ -0,0 +1,11 @@
using Govor.Core.Models;
namespace Govor.Core.Repositories;
public interface IUsersWriter
{
public Task Add(User user);
public Task Update(User user);
public Task Remove(User user);
public Task Remove(Guid userId);
}