article.cs

来自「Maolz个人展示网站源码,全部的代码,.net」· CS 代码 · 共 50 行

CS
50
字号
using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;

namespace SubSonic.Generated
{
    using System.Linq;
	public partial class Article
	{
        public string GetTags()
        {
            if (GetTagCollection().Count == 0)
                return string.Empty;
            string temp = string.Empty;
            foreach (Tag t in GetTagCollection())
            {
                temp += t.Name + ",";
            }
            return temp.Substring(0, temp.Length - 1);
        }
        public string GetCategoryNames() 
        {
            if (this.GetCategoryCollection().Count == 0)
                return string.Empty;
            
            System.Collections.Generic.List<string> list=new List<string>();
            GetCategoryCollection().ForEach(t => list.Add(t.Name));
            return String.Join(",", list.ToArray());
        }
        public CommentCollection GetCommentCollection() 
        {
            //Query qry = Comment.CreateQuery().WHERE(Comment.Columns.FkArticleId, this.PKId).ORDER_BY(Comment.Columns.PKId, "asc");
            //Commentqry.ExecuteReader
            return DB.Select().From<Comment>().Where(Comment.Columns.FkArticleId).IsEqualTo(this.PKId).ExecuteAsCollection<CommentCollection>().OrderByAsc(Comment.Columns.PKId);
        }
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?