Skip to content

Poudyn/RefToken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RefToken

Framework for capturing the value of an object using a string path

  • Currently you can only get values from variables and lists (using index)

How to use

  • High traffic
var refToken = new RefToken.RefToken("string path");
var found =  refToken.Select<string>(targetObject, out string result);
if(found)
{
  Console.WriteLine(result);
}
  • Low traffic
var found = RefToken.Select<string>(targetObject,"string path",out string result);
if(found)
{
  Console.WriteLine(result);
}

Access the value using the string path

class Persone
{
  public string Name {set;get;}
}
class Buyer
{
  public Persone persone {set;get;}
}
var buyer = new Buyer { Persone = new Persone {Name = "Poudyn"} };
var found = RefToken.Select<string>(buyer,"Persone.Name",out string result);
if(found)
{
  Console.WriteLine(result);
}

Contact with me : Telegram

News : Telegram Channel

Releases

No releases published

Packages

No packages published

Languages