using XYY.Model.Standard;
using XYY.Core.Standard.Data.Infrastructure;
using Dapper;

namespace XYY.Data.Standard
{
    public interface IUserInfoRepository : IBaseRepository<User_Info>
    {
        void UpdateInfo(User_Info user_Info);
    }
    public class UserInfoRepository : BaseRepository<User_Info>, IUserInfoRepository
    {
        public UserInfoRepository(IUnitOfWork unitOfWork)
            : base(unitOfWork)
        { }

        public async void UpdateInfo(User_Info user_Info)
        {
            string sql = "UPDATE[dbo].[User_Info] set [NickName]=@NickName,Company=@Company,Phone=@Phone,WeChat=@WeChat,QQ=@QQ,Email=@Email,OpenId=@OpenId where id =@Id";
            await _unitOfWork.Connection.ExecuteAsync(sql, user_Info, _unitOfWork.Transaction);
        }
    }
}
