コード例 #1
0
 private static MemberDeclarationSyntax ExtensionMethodWithSeparateArguments(HassService service, string serviceName, string entityTypeName, ServiceArguments serviceArguments)
 {
     return(ParseMethod(
                $@"void {GetServiceMethodName(serviceName)}(this {entityTypeName} target, {serviceArguments.GetParametersList()})
             {{
                 target.CallService(""{serviceName}"", {serviceArguments.GetNewServiceArgumentsTypeExpression()});
             }}")
            .ToPublic()
            .ToStatic()
            .WithSummaryComment(service.Description)
            .WithParameterComment("target", $"The {entityTypeName} to call this service for")
            .WithParameterComments(serviceArguments));
 }