private static IList <ContentReply> GetContentReplyBySql(string safeSql) { List <ContentReply> list = new List <ContentReply>(); DataTable table = DBHelper.GetDataSet(safeSql); foreach (DataRow row in table.Rows) { ContentReply contentreply = new ContentReply(); contentreply.Replyid = (int)row["ReplyID"]; contentreply.Recontentery = (string)row["ReContentery"]; contentreply.Createon = (DateTime)row["CreatedOn"]; contentreply.Userid = (int)row["UserID"]; contentreply.Topicid = (int)row["TopicID"]; //contentreply.User.Headurl = (string)row["HeadUrl"]; contentreply.Content = CCService.GetContentByTId((int)row["TopicID"]); //外键的处理 contentreply.User = UserService.GetUserById1((int)row["UserID"]); //外键的处理 list.Add(contentreply); } return(list); }