最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

c#中xml文檔注釋編譯dll引用到其它項(xiàng)目示例

 更新時(shí)間:2014年02月07日 15:33:44   作者:  
這篇文章主要介紹了c#中xml文檔注釋編譯dll引用到其它項(xiàng)目示例,需要的朋友可以參考下

復(fù)制代碼 代碼如下:

<#@ template debug="True" hostspecific="True" language="C#" #><#@ assembly name="System.Core" #>
<#@ assembly name="System.Data" #>
<#@ assembly name="System.xml" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Data" #>
<#@ import namespace="System.Data.SqlClient" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>

using System;
using DotNet.Framework.DataAccess.Attribute;
using System.Data;
namespace MyProject.Entities
{   
<#
    string connectionString = "Data Source=localhost;Initial Catalog=EDNFramework;User ID=sa;pwd=as";
    SqlConnection conn = new SqlConnection(connectionString);
    conn.Open();
    System.Data.DataTable schema = conn.GetSchema("TABLES");
    string selectQuery = "select * from @tableName";
    SqlCommand command = new SqlCommand(selectQuery,conn);
    SqlDataAdapter ad = new SqlDataAdapter(command);
    System.Data.DataSet ds = new DataSet();
    foreach(System.Data.DataRow row in schema.Rows)
    {
#>

    public class <#= row["TABLE_NAME"].ToString()#>
    {<#
        ds.Tables.Clear();
        command.CommandText = selectQuery.Replace("@tableName",row["TABLE_NAME"].ToString());
        ad.FillSchema(ds, SchemaType.Mapped, row["TABLE_NAME"].ToString());
        foreach (DataColumn dc in ds.Tables[0].Columns)
        {#>

        [DataMapping("<#= dc.ColumnName #>")]
        public <#= dc.DataType.Name #> <#= dc.ColumnName #> { get; set; }
       <#}#>       
    }           
    <#}#>              
}

相關(guān)文章

最新評(píng)論

文成县| 峨眉山市| 湘潭市| 亚东县| 天台县| 平武县| 突泉县| 灵石县| 碌曲县| 宜都市| 中宁县| 响水县| 肃宁县| 新巴尔虎右旗| 寿宁县| 平定县| 望江县| 莱阳市| 赣榆县| 吉水县| 军事| 汾阳市| 锡林浩特市| 仁化县| 儋州市| 兴城市| 四平市| 陆川县| 长沙县| 莱芜市| 瑞昌市| 绥棱县| 连州市| 井冈山市| 博客| 龙岩市| 普兰店市| 桂平市| 岢岚县| 左贡县| 安远县|