asp.net中引用同一個(gè)項(xiàng)目中的類庫 避免goToDefinition時(shí)不能到達(dá)真正的定義類
更新時(shí)間:2011年10月18日 21:32:36 作者:
asp.net中引用同一個(gè)項(xiàng)目中的類庫 避免 goToDefinition時(shí)不能到達(dá)真正的定義類
新建一個(gè)解決方案: Api
添加類庫 APi.Data
APi.Data 新建一個(gè) Entity
public class Entity
{
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
添加類庫 APi.Web
引用 APi.Data.dll
APi.Web下
APi.Data.Entity t = new APi.Data.Entity();
Entity的goToDefinition
結(jié)果是:
using System;
namespace APi.Data
{
public class Entity
{
public Entity();
public int Id { get; set; }
public string Name { get; set; }
}
}
而不是:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Api.Data
{
public class Entity
{
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
}
添加類庫 APi.Data
APi.Data 新建一個(gè) Entity
復(fù)制代碼 代碼如下:
public class Entity
{
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
添加類庫 APi.Web
引用 APi.Data.dll
APi.Web下
APi.Data.Entity t = new APi.Data.Entity();
Entity的goToDefinition
結(jié)果是:
復(fù)制代碼 代碼如下:
using System;
namespace APi.Data
{
public class Entity
{
public Entity();
public int Id { get; set; }
public string Name { get; set; }
}
}
而不是:
復(fù)制代碼 代碼如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Api.Data
{
public class Entity
{
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
}
相關(guān)文章
從別人那拷下來的幾點(diǎn)Session使用的經(jīng)驗(yàn)
從別人那拷下來的幾點(diǎn)Session使用的經(jīng)驗(yàn)...2007-04-04
關(guān)于多對多關(guān)系表無法更新與插入的問題
這篇文章主要介紹了關(guān)于多對多關(guān)系表無法更新與插入的問題 的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2016-07-07
值得收藏的asp.net基礎(chǔ)學(xué)習(xí)筆記
這篇文章主要分享了一份值得大家收藏的asp.net基礎(chǔ)學(xué)習(xí)筆記,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-09-09
ASP.NET中實(shí)現(xiàn)導(dǎo)出ppt文件數(shù)據(jù)的實(shí)例分享
這篇文章主要介紹了ASP.NET中實(shí)現(xiàn)導(dǎo)出ppt文件數(shù)據(jù)的實(shí)例分享,實(shí)例代碼用C#語言編寫,利用.NET的庫實(shí)現(xiàn)起來還是比較簡潔的,需要的朋友可以參考下2016-02-02
ASP.NET MVC4 利用uploadify.js多文件上傳
本文主要介紹了ASP.NET MVC4利用uploadify.js實(shí)現(xiàn)多文件上傳的方法代碼。具有很好的參考價(jià)值。下面跟著小編一起來看下吧2017-03-03

