Skip to content

Attribute property generate doesn't work correctly. #11

Open
@kami-poi

Description

@kami-poi

Hello, I found that when I try to set properties for an attribute, the generator could not generate correct code. For example, when I apply an attribute like this:

[Authorize(Roles = "Admin")]
public async Task TestMethodAsync() {...}

The generator generates this code:

[Microsoft.AspNetCore.Authorization.Authorize()]
[HttpPost("TestMethod")]
public async Task<IActionResult> TestMethod() {...}

I have fixed this and will create a new pull request later. I'm not familiar with source generator, so maybe my code is not good enough. It just works to resolve this problem, and provides an idea to resolve this problem :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions