protected override Task <IEnumerable <Blogger> > QueryAsync(string sql, object parameters = null, IDbConnection connection = null) { if (connection == null) { using (connection = DBSessionFactory.CreateDbConnection(ConnectionString)) { return(connection.QueryAsync <Blogger, Category, Blogger>(sql, (b, c) => { b.Category = c; return b; }, parameters, splitOn: "Name")); } } else { return(connection.QueryAsync <Blogger, Category, Blogger>(sql, (b, c) => { b.Category = c; return b; }, parameters, splitOn: "Name")); } }
public async Task <Blogger> GetDetailAsync(int id) { string sql = @$ "SELECT TOP 1 b.*, c.Name FROM {TableName} AS b LEFT JOIN Category AS c ON b.CategoryId=c.Id WHERE b.IsDelete=0 AND b.IsShow=1 AND b.Id=@Id"; using (IDbConnection connection = DBSessionFactory.CreateDbConnection(ConnectionString)) { var result = await connection.QueryAsync <Blogger, Category, Blogger>(sql, (b, c) => { b.Category = c; return(b); }, new { Id = id }, splitOn : "Name"); return(result.FirstOrDefault()); } }
public IEnumerable <Reply> GetReplyAllFather(string whereStr) { return(DBSessionFactory.GetDBSession().ReplyDAL.GetReplyAllFather(whereStr)); }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().SensitiveDAL; }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().NotificationDAL; }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().CategoryDAL; }
public User Login(string username, string password) { return(DBSessionFactory.GetDBSession().UserDAL.Login(username, password)); }
public User GetUserByName(string name) { return(DBSessionFactory.GetDBSession().UserDAL.GetUserByName(name)); }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().SourceWebDAL; }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().EXArticleDAL; }
/// <summary> /// 得到某个日期时间段的更新的博客 /// </summary> /// <param name="begin"></param> /// <param name="end"></param> /// <returns></returns> public int GetUpdateRecordsCountByDate(DateTime begin, DateTime end) { return(DBSessionFactory.GetDBSession().EXArticleDAL.GetUpdateRecordsCountByDate(begin, end)); }
/// <summary> /// 得到 分类数量 /// </summary> /// <returns></returns> public IEnumerable <DapperDict> GetCategoryCount() { return(DBSessionFactory.GetDBSession().EXArticleTempDAL.GetCategoryCount()); }
/// <summary> /// 得到一段时间内的增加的和修改的数量 /// </summary> /// <param name="begin"></param> /// <param name="end"></param> /// <returns></returns> public IEnumerable <DapperAddAndUpdateRecord> GetAddAndUpdateRecordsByDate(DateTime begin, DateTime end) { return(DBSessionFactory.GetDBSession().EXArticleTempDAL.GetAddAndUpdateRecordsByDate(begin, end)); }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().TopicforumDAL; }
public User GetUserByEmail(string email) { return(DBSessionFactory.GetDBSession().UserDAL.GetUserByEmail(email)); }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().VideoDAL; }
public override void SetDAL() { idal = DBSessionFactory.GetDBSession().CarouselDAL; }