Created one part of all endpoints to admin the user
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Users;
|
||||
|
||||
public class GetUserByCriteriaSpec : SingleResultSpecification<User>
|
||||
{
|
||||
public GetUserByCriteriaSpec(string username, string email, int? id)
|
||||
{
|
||||
Query
|
||||
.Where(x => (x.Username == username || x.Email == email) && x.Id != id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using BeReadyBackend.Models;
|
||||
|
||||
namespace BeReadyBackend.Specifications.Users;
|
||||
|
||||
public class GetUsersByScoreSpec : Specification<User>
|
||||
{
|
||||
public GetUsersByScoreSpec()
|
||||
{
|
||||
Query
|
||||
.OrderByDescending(x => x.Score);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user