Furion 框架流变对象模块。
$ dotnet add package Shapeless.AspNetCoreShapeless is a high-performance C# open-source library that offers a flexible manipulation experience akin to JavaScript JSON, supporting dynamic addition, deletion, lookup, and modification along with Linq and Lambda expression queries. It significantly simplifies the construction and manipulation of runtime objects while maintaining simplicity and robust performance characteristics.
JSON Manipulation: Offers functionalities for adding, deleting, querying, and modifying similar to
JavaScript, with compatibility for Linq and Lambda expressions.Web Development Friendly: Seamlessly integrates with ASP.NET Core WebAPI and MVC, simplifying HTTP request
handling and API development processes.JSON serialization and deserialization capabilities, suitable for data
exchange and storage needs.JSON objects, automatically
triggering event notifications.98%..NET 8+ Compatibility: Can be deployed and used in environments running .NET 8 and higher versions.dotnet add package Shapeless
We have many examples on our homepage. Here's your first one to get you started:
dynamic clay = Clay.Parse("""{"id":1,"name":"shapeless"}""");
// Add Property
clay.author = "百小僧";
clay["company"] = "百签科技";
clay.homepage = new[] { "https://furion.net/", "https://baiqian.com" };
clay.number = 10;
// Add Method
clay.sayHello = (Func<string>)(() => $"Hello, {clay.name}!");
clay.Increment = new Action(() => clay.number++);
// Call Method
Console.WriteLine(clay.number); // number: 10
clay.Increment();
Console.WriteLine(clay.number); // number: 11
// Print JSON
Console.WriteLine($"{clay.sayHello()}\r\n{clay:UZ}");
After running the above code, the console outputs the following content:
10
11
Hello, shapeless!
{"id":1,"name":"shapeless","author":"百小僧","company":"百签科技","homepage":["https://furion.net/","https://baiqian.com"],"number":11}
You can find the Shapeless documentation on our homepage.
The main purpose of this repository is to continue developing the core of Shapeless, making it faster and easier to use. The development of Shapeless is publicly hosted on Gitee, and we appreciate community contributions for bug fixes and improvements.
Shapeless is released under the MIT open source license.