프로젝트
GitHub에서 보기
serdedotnet/serde
소개
Serde.NET is a C# port of the popular Serde serialization library for Rust
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalSerde.NET
Serde.NET is a port of the popular serde.rs Rust serialization/deserialization library to .NET.
For an overview, see Overview.
Start by adding the serde NuGet package:
dotnet add package serde
To generate serialization/deserialization info for a type, now do the following:
- Mark the type partial
- Add the
[GenerateSerde]attribute
using Serde;
using Serde.Json;
string output = JsonSerializer.Serialize(new SampleClass());
// prints: {"X":3,"Y":"sample"}
Console.WriteLine(output);
var deserialized = JsonSerializer.Deserialize<SampleClass>(output);
// prints SampleClass { X = 3, Y = sample }
Console.WriteLine(deserialized);
[GenerateSerde]
partial record SampleClass
{
// automatically includes public properties and fields
public int X { get; init; } = 3;
public string Y = "sample";
}
관련 프로젝트 살펴보기
불러오는 중…