I'm working on a ASP.NET MVC project, in a Action inside a Controller I try to use STG_Route.ADDproperty value inside [Route()] data annotation like this :[Route(STG_Route.ADD)]
but Visual Studio show me this error :
An object reference is required for the non-static field, method, or property 'AdminController.STG_Route'
STG_Route is an object of a class, this class is STG_Route
STG_Route class code :
public class STG_Route:Routes
{
public override string ADD => "/STG/Add";
public override string SHOW => "/STG/Show";
public override string PROFILE => "/STG/{CODE}";
}
Routes is another class
Please any help about how can I use value of a ADD property inside [Route()]
Thanks in advance.