FIC_Solar/SolarPower/Repository/Interface/IRepositoryBase.cs
2021-06-17 21:41:21 +08:00

71 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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<int> AddOneAsync(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);
/// <summary>
/// 透過Id軟刪除單一筆資料(不同資料表)
/// </summary>
/// <param name="id"></param>
/// <param name="tablename"></param>
/// <returns></returns>
Task DeleteOneOtherTable(int id, string tablename);
}
}