Refactored User

This commit is contained in:
Cristiano
2025-11-20 15:38:53 +01:00
parent 0b72549143
commit 165c9b9322
11 changed files with 76 additions and 77 deletions

View 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);
}
}

View 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);
}
}