SkillAgentSearch skills...

Newbe.ObjectVisitor

You can visit all properties about your class or struct by this lib with high performance as you visit properties in hard coding way.

Install / Use

/learn @newbe36524/Newbe.ObjectVisitor
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Ow, my dear fellow, I am very glad that you have paid attention to this repository and made some attempts. This repository is still in a very preliminary stage. After three seconds of careful consideration. I decide to archive this repository, the main reason is that there are not too many time to maintain. Later I'll consider making some simple videos or articles about my experience writing this repository code. Thanks again for your interest.

In the meantime, I suggest that if you still have similar needs, why not focus on the following projects or documents.


Newbe.ObjectVisitor

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

All Contributors

<!-- ALL-CONTRIBUTORS-BADGE:END -->
  • build and scan
  • Codecov
  • Coverage
  • Quality Gate Status
  • Codacy Badge
  • xml document Crowdin
  • documents Crowdin

Banner

You can visit all properties about your class by this lib with high performance as you visit properties in hard coding way.

For example, here is object in your code.

var order = new OrderInfo();

And, you want to print all properties of the order.

for(var pInfo in typeof(OrderInfo).GetProperties())
{
    Console.Writeline($"{pInfo.Name}: {pInfo.GetValue(order)}");
}

By using this lib, you can handle it in this way:

// call .V what is a static extension method
// you get a visitor object for order
var visitor = order.V();

visitor.ForEach(context=>{
    var name = context.Name;
    var value = context.Value;
    Console.Writeline($"{name}: {value}");
}).Run();

// you can also make it into one line
order.V().ForEach(c=> Console.Writeline($"{c.Name}: {c.Value}")).Run();

// or using quick style
order.FormatToString();

Why do I need this?

  • It is faster. This lib is impletmented with Expression Trees that cost 1/10 time as in Reflection way.
  • It is readable. This lib can generate a lambda func to handle the code flow you create that just as your hard coding without reflection.
  • It is extendable. If you can visit all properties of a object in easy way, you can validate them as you wish, change some value if there are something sensitive, creare a mapper like automapper, and etc.

API

Please check out the latest full API documents in site below:

Packages

| package | version | download | descrption | | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | | Newbe.ObjectVisitor | Newbe.ObjectVisitor.Version | Newbe.ObjectVisitor.Download | Core about Newbe.ObjectVisitor |

Contact

QQ Group: 【Newbe.Claptrap CL4P-TP 610394020 】:https://jq.qq.com/?_wv=1027&k=Lkhbwj0o

Stargazers over time

Stargazers over time

Contributors ✨

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://www.newbe.pro"><img src="https://avatars1.githubusercontent.com/u/7685462?v=4" width="100px;" alt=""/><br /><sub><b>Newbe36524</b></sub></a><br /><a href="#blog-newbe36524" title="Blogposts">📝</a> <a href="https://github.com/newbe36524/Newbe.ObjectVisitor/commits?author=newbe36524" title="Code">💻</a> <a href="https://github.com/newbe36524/Newbe.ObjectVisitor/commits?author=newbe36524" title="Documentation">📖</a> <a href="#tutorial-newbe36524" title="Tutorials">✅</a></td> <td align="center"><a href="https://github.com/kotoneme"><img src="https://avatars3.githubusercontent.com/u/43395111?v=4" width="100px;" alt=""/><br /><sub><b>kotone</b></sub></a><br /><a href="#design-kotoneme" title="Design">🎨</a></td> <td align="center"><a href="https://github.com/EventHorizon1024"><img src="https://avatars3.githubusercontent.com/u/21670962?v=4" width="100px;" alt=""/><br /><sub><b>黑洞视界</b></sub></a><br /><a href="#ideas-EventHorizon1024" title="Ideas, Planning, & Feedback">🤔</a></td> </tr> </table> <!-- markdownlint-enable --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the all-contributors specification. Contributions of any kind welcome!

View on GitHub
GitHub Stars88
CategoryDevelopment
Updated3mo ago
Forks21

Languages

C#

Security Score

97/100

Audited on Dec 28, 2025

No findings