Skip to main content

to_csharp_name

Function to_csharp_name 

Source
pub fn to_csharp_name(name: &str) -> String
Expand description

Convert a Rust snake_case name to C# PascalCase convention with initialism uppercasing.

Converts snake_case to PascalCase via heck and then restores C#-preserved initialisms. The C# list is intentionally narrow (Microsoft’s framework design guidelines prefer Json/Http/Url over JSON/HTTP/URL), so only product names like GraphQL and short 2-letter abbreviations get all-caps. This keeps method names like to_jsonToJson in lockstep with alef’s hardcoded {Type}ToJson / {Type}FromJson helper declarations.