-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C sharp support #39
base: master
Are you sure you want to change the base?
C sharp support #39
Conversation
Adds various copypasta boilerplate to support csharp, starts working on templating
I'd be interested in this. |
@DBMasterC Would you please provide some info on how to use your changes? Generating C# clients it pretty much what I need but I am a bit puzzled on how to do it. |
While I am using this in "production", my signalR footprint is very small, and this is very much more a PoC effort at the functionality than it is a full-featured, ready-to-go part of this library. Anyhow, I use it in much the same way as the var csharpGenSettings = new SigSpecToCSharpGeneratorSettings();
csharpGenSettings.CSharpGeneratorSettings.Namespace = "Namespace.SignalR.Clients";
var csharpGenerator = new SigSpecToCSharpGenerator(csharpGenSettings);
string file2 = csharpGenerator.GenerateClients(document);
targetFile = new FileInfo(args[1].Trim('\''));
await File.WriteAllTextAsync(targetFile.FullName, file2);
Console.WriteLine($"Generated SigSpec CSharp code to {targetFile.FullName}"); |
FYI, as an alternative to generating c# clients, you could use https://github.com/mehmetakbulut/SignalR.Strong |
Console.WriteLine("\nGenerated SigSpec document:"); | ||
Console.WriteLine(json); | ||
Console.ReadKey(); | ||
|
||
var codeGeneratorSettings = new SigSpecToTypeScriptGeneratorSettings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you maybe keep the ts code here (commented) so we have both samples here?
Humble addition which I'm using to generate some C# clients based on how they're defined on our backend. Among other things, It's not regenerating a hub, and the output could be prettier, but I'm curious your take on it as a first step.