using Dapper; using System.Threading.Tasks; using Znyc.Cloudcar.Admin.Commons.IDbContext; using Znyc.Cloudcar.Admin.Commons.Repositories; using Znyc.Cloudcar.Admin.Security.Entitys; using Znyc.Cloudcar.Admin.Security.IRepositories; namespace Znyc.Cloudcar.Admin.Security.Repositories { /// /// 应用仓储实现 /// public class MessageRepository : BaseRepository, IMessageRepository { public MessageRepository() { } public MessageRepository(IDbContextCore context) : base(context) { } ///// ///// 添加信息 ///// ///// //public async Task InsertAsync(MessageEntity entity) //{ // string sql = string.Format( // @"INSERT INTO `message`(`CreatedUserId`, `CreatedTime`, `IsDeleted`, `SendId`, `Type`, `GroupId`, // `Content`, `SendTime`, `ProductId`, `Title`, `MessageTitle`, `ProductType`) VALUES // ({0}, now(), 0, {1},{2},{3}, '{4}', now(), {5}, '{6}','{7}', {8}); SELECT LAST_INSERT_ID();", // entity.SendId, entity.SendId, entity.Type, entity.GroupId, entity.Content, entity.ProductId, // entity.Title, entity.MessageTitle, entity.ProductType); // //var input= await DapperConn.QueryFirstOrDefaultAsync(sql); // long input = await DapperConn.ExecuteScalarAsync(sql, entity); // return input; //} } }