Update ef core utils

This commit is contained in:
Guilherme Werner 2026-05-08 19:45:33 -03:00
parent 9678659892
commit 02642f9dfa
5 changed files with 30 additions and 164 deletions

View file

@ -0,0 +1,43 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Tribufu.EntityFrameworkCore
{
public interface IRepository<T, K> where T : class
{
void Seed();
Task SeedAsync();
IList<T> List();
Task<IList<T>> ListAsync();
IList<T> List(uint page, uint limit);
Task<IList<T>> ListAsync(uint page, uint limit);
T? Find(K key);
Task<T?> FindAsync(K key);
T? Create(T entity);
Task<T?> CreateAsync(T entity);
T? Update(T entity);
Task<T?> UpdateAsync(T entity);
void Delete(K key);
Task DeleteAsync(K key);
void Delete(T entity);
Task DeleteAsync(T entity);
}
}