Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexinea/alexinea-fast-member-extensions
Extensions for FastMember
https://github.com/alexinea/alexinea-fast-member-extensions
Last synced: about 2 months ago
JSON representation
Extensions for FastMember
- Host: GitHub
- URL: https://github.com/alexinea/alexinea-fast-member-extensions
- Owner: alexinea
- License: apache-2.0
- Created: 2020-12-02T00:55:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T14:14:47.000Z (about 2 years ago)
- Last Synced: 2024-04-27T10:09:39.493Z (9 months ago)
- Language: C#
- Size: 16.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FastMember Extensions
[![NuGet](https://img.shields.io/nuget/v/Alexinea.FastMember.Extensions.svg)](https://nuget.org/packages/Alexinea.FastMember.Extensions)
[![Nuget](https://img.shields.io/nuget/dt/Alexinea.FastMember.Extensions.svg)](https://nuget.org/packages/Alexinea.FastMember.Extensions)This project is an extension of [Alexinea.FastMember](https://github.com/alexinea/alexinea-fast-member). Read and write property based on [FastMember](https://github.com/mgravell/fast-member).
In addition, we also recommend that you use [Leo](https://github.com/night-moon-studio/leo) based on [NCC Natasha](https://github.com/dotnetcore/Natasha), a high-performance object reading and writing component.
## Installing
```
Install-Package Alexinea.FastMember.Extensions
```## Usage
Get the value from the object.
```c#
var model = new Model();var val1 = model.GetPropertyValue(typeof(Model), "PropertyName"); // model may be an object
var val2 = model.GetPropertyValue("PropertyName"); // model must be a specific type
var val3 = model.GetPropertyValue(t => t.PropertyName);
```To set a value into the object.
```c#
var model = new Model();model.SetPropertyValue(typeof(Model), "PropertyName", value); // model may be an object
model.SetPropertyValue("PropertyName", value); // model must be a specific type
model.SetPropertyValue(t => t.PropertyName, value);
```## License
[Apache License 2.0](LICENSE)