53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace SolarPower.Repository.Interface
|
||
{
|
||
public interface IRepositoryBase<T> where T : class
|
||
{
|
||
/// <summary>
|
||
/// 透過Id,取得單一資料
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <returns></returns>
|
||
Task<T> GetOneAsync(int id);
|
||
|
||
/// <summary>
|
||
/// 取得所有資料
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
Task<List<T>> GetAllAsync();
|
||
|
||
/// <summary>
|
||
/// 新增資料
|
||
/// </summary>
|
||
/// <param name="entity"></param>
|
||
/// <param name="properties"></param>
|
||
/// <returns></returns>
|
||
Task<int> AddAsync(T entity, List<string> properties);
|
||
|
||
/// <summary>
|
||
/// 修改資料
|
||
/// </summary>
|
||
/// <param name="entity"></param>
|
||
/// <param name="properties"></param>
|
||
/// <returns></returns>
|
||
Task Update(T entity, List<string> properties);
|
||
|
||
/// <summary>
|
||
/// 透過Id,軟刪除單一筆資料
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <returns></returns>
|
||
Task DeleteOne(int id);
|
||
/// <summary>
|
||
/// 透過Id,實際刪除單一筆資料
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
Task PurgeOneAsync(int id);
|
||
}
|
||
}
|