Make custom rules and add these rule into sonarqube in C#

i want to make custom rules and add these rules into sonarqbue in C#.
how can i do it? Is it right to use third-party Roslyn analyzers ?
i want any guide or sample for it.

And also i want show result in sonarqube ui.
how can i do.?

The README here should help you. GitHub - SonarSource/sonarqube-roslyn-sdk: SDK for SonarQube Roslyn Analyzer Plugins