using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XF.Domain.Repository.Events;

public interface IUpdateDatabaseEvent<TEntity> where TEntity : new()
{
    /// <summary>
    /// 数据库更新完成后
    /// </summary>
    /// <param name="entity"></param>
    void OnUpdated(TEntity entity);

    /// <summary>
    /// 数据库插入完成后
    /// </summary>
    /// <param name="entity"></param>
    void OnInserted(TEntity entity);

    /// <summary>
    /// 数据库更新之前
    /// 实体中的每个字段都会触发一次
    /// </summary>
    /// <param name="entity"></param>
    void OnUpdating(TEntity entity);

    ///// <summary>
    ///// 数据库插入之前
    ///// </summary>
    ///// <param name="entity"></param>
    //void OnInserting(TEntity entity);
}
