https://github.com/lauanguermandi/fastreflections
FastReflections is a fast and lightweight .NET library that simplifies and speeds up access to methods, properties, and types using cached reflection and clean syntax.
https://github.com/lauanguermandi/fastreflections
dotnet reflections type-search
Last synced: 4 months ago
JSON representation
FastReflections is a fast and lightweight .NET library that simplifies and speeds up access to methods, properties, and types using cached reflection and clean syntax.
- Host: GitHub
- URL: https://github.com/lauanguermandi/fastreflections
- Owner: LauanGuermandi
- Created: 2025-04-09T23:16:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-11T01:03:04.000Z (about 1 year ago)
- Last Synced: 2025-10-27T03:27:23.780Z (8 months ago)
- Topics: dotnet, reflections, type-search
- Language: C#
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastReflections
**FastReflections** is a lightweight and high-performance utility library for .NET that provides fast, cached reflection-based access to methods, properties, using expressions, and types with clean and expressive syntax.
---
## Installation
```bash
dotnet add package FastReflections
```
---
## Usage
### Invoke Method
```csharp
var instance = new MyClass();
var method = typeof(MyClass).GetMethod("SayHello");
var result = FastReflections.Invoke(method, instance, "John");
// result => "Hello, John"
```
### Get Property
```csharp
var instance = new MyClass { Name = "FastReflections" };
var value = FastReflections.GetPropertyValue(instance, x => x.Name);
// value => "FastReflections"
```
### Set Property
```csharp
var instance = new MyClass();
FastReflections.SetPropertyValue(instance, x => x.Name, "Updated");
// instance.Name => "Updated"
```
### Find Type by Name
```csharp
var type = FastReflections.GetTypeByName("MyNamespace.MyClass");
// type => typeof(MyClass)
```
---
## When to Use
Use `FastReflections` when:
- You need dynamic access to methods and properties
- You want performance without writing boilerplate reflection code
- You’re building frameworks, tools, or extensible plugins
---
## Internals
- Uses `Expression Trees` for performance
- Thread-safe `ConcurrentDictionary` for caching
- Automatic type cache loading via `AssemblyLoad` event
---
## License
MIT License © LauanGuermandi