References in asp.net to class libraries in the same project prevent goToDefinition from not being able to reach the actual defined class
- 2020-05-16 06:40:21
- OfStack
Create a new solution: Api
Add the class library APi.Data
APi.Data create a new Entity
Add the class library APi.Web
Reference APi. Data. dll
APi Web next
APi.Data.Entity t = new APi.Data.Entity();
The Entity goToDefinition
The result is:
Instead of:
Add the class library APi.Data
APi.Data create a new 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; }
}
}
Add the class library APi.Web
Reference APi. Data. dll
APi Web next
APi.Data.Entity t = new APi.Data.Entity();
The Entity goToDefinition
The result is:
using System;
namespace APi.Data
{
public class Entity
{
public Entity();
public int Id { get; set; }
public string Name { get; set; }
}
}
Instead of:
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; }
}
}
}