Create a solution: Api
Add class library APi. Data
APi. Data creates an Entity
Copy codeThe Code is as follows: 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 a class library APi. Web
Reference APi. Data. dll
Under APi. Web
APi. Data. Entity t = new APi. Data. Entity ();
GoToDefinition of Entity
The result is:Copy codeThe Code is as follows: using System;
Namespace APi. Data
{
Public class Entity
{
Public Entity ();
Public int Id {get; set ;}
Public string Name {get; set ;}
}
}
Instead:Copy codeThe Code is as follows: 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 ;}
}
}
}