MASA.Framework icon indicating copy to clipboard operation
MASA.Framework copied to clipboard

Minimal APIs support auto map for RESTful

Open doddgu opened this issue 3 years ago • 4 comments

like mvc controller:

public class TestService: ServiceBase
{
    public TestService()
    {
        MapToRESTful();
    }

    dynamic Get(int Id)
    {
        // todo something
    }
}

doddgu avatar Jan 18 '22 06:01 doddgu

lack RequireAuthorization method like MapControllers().RequireAuthorization()

MayueCif avatar Jul 26 '22 06:07 MayueCif

@zhenlei520 PTAL, maybe it can add to 0.6?

doddgu avatar Jul 26 '22 07:07 doddgu

lack RequireAuthorization method like MapControllers().RequireAuthorization()

@MayueCif like this?

App.MapGet("/ping/healthy", () =>
{
    return "success";
}).RequireAuthorization("user");

Currently, only a single method specification is supported. Specifying policies by group is not currently supported. We will support it in subsequent releases. Try to support in 0.6.0

zhenlei520 avatar Jul 27 '22 05:07 zhenlei520

@zhenlei520 PTAL, maybe it can add to 0.6?

@doddgu Try to support in 0.6.0

zhenlei520 avatar Jul 27 '22 05:07 zhenlei520

#241

doddgu avatar Sep 19 '22 01:09 doddgu