mirror of
https://github.com/Tribufu/TribufuDotNet
synced 2026-08-09 21:01:07 +00:00
Update ef core utils
This commit is contained in:
parent
9678659892
commit
02642f9dfa
5 changed files with 30 additions and 164 deletions
43
src/Tribufu.EntityFrameworkCore/IRepository.cs
Normal file
43
src/Tribufu.EntityFrameworkCore/IRepository.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue