forked from sanchezvem/PyroFetes
Refactored User
This commit is contained in:
13
PyroFetes/Specifications/Users/GetUserByIdSpec.cs
Normal file
13
PyroFetes/Specifications/Users/GetUserByIdSpec.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Users;
|
||||
|
||||
public sealed class GetUserByIdSpec : Specification<User>
|
||||
{
|
||||
public GetUserByIdSpec(int userId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == userId);
|
||||
}
|
||||
}
|
||||
13
PyroFetes/Specifications/Users/GetUserByNameSpec.cs
Normal file
13
PyroFetes/Specifications/Users/GetUserByNameSpec.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Users;
|
||||
|
||||
public sealed class GetUserByNameSpec : Specification<User>
|
||||
{
|
||||
public GetUserByNameSpec(string userName)
|
||||
{
|
||||
Query
|
||||
.Where(x=> x.Name == userName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user