using System;
using System.Collections.Generic;
using System.Text;

namespace JiShe.CollectBus.Analyzers
{
    public interface ISourceAnalyzersProvider<T>
    {
        /// <summary>
        /// 获取属性值
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        object GetPropertyValue(T entity, string propertyName);

        /// <summary>
        /// 设置属性值
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="propertyName"></param>
        /// <param name="value"></param>
        void SetPropertyValue(T entity, string propertyName, object value);

        /// <summary>
        /// 判断是否是元组属性
        /// </summary>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        bool IsTupleProperty(string propertyName);

        /// <summary>
        /// 获取元组属性值
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="tuplePropertyName"></param>
        /// <returns></returns>
        (object Item1, object Item2) GetTupleParts(T entity, string tuplePropertyName);
    }
}
