19 lines
954 B
C#
19 lines
954 B
C#
namespace MyOffice.Data.Repositories.Item;
|
|
|
|
using MyOffice.Data.Models.Items;
|
|
|
|
public interface IItemRepository
|
|
{
|
|
List<Item> GetAll(Guid userId);
|
|
Task<List<Item>> GetAllAsync(Guid userId, CancellationToken cancellationToken = default);
|
|
List<Item> GetByCategory(Guid userId, Guid categoryId);
|
|
Task<List<Item>> GetByCategoryAsync(Guid userId, Guid categoryId, CancellationToken cancellationToken = default);
|
|
Item? GetByGlobal(Guid userId, Guid globalItemId);
|
|
Task<Item?> GetByGlobalAsync(Guid userId, Guid globalItemId, CancellationToken cancellationToken = default);
|
|
bool Add(Item item);
|
|
Task<bool> AddAsync(Item item, CancellationToken cancellationToken = default);
|
|
bool Update(Item item);
|
|
Task<bool> UpdateAsync(Item item, CancellationToken cancellationToken = default);
|
|
List<Item> Find(Guid userId, string term, int limit);
|
|
Task<List<Item>> FindAsync(Guid userId, string term, int limit, CancellationToken cancellationToken = default);
|
|
} |