vipwan/Biwen.QuickApi

提供绑定器对 FromQuery,FromHeader,FromRoute 的原生支持!

vipwan opened this issue · 1 comments

vipwan commented
    public class HelloApiRequest : BaseRequest<HelloApiRequest>
    {
        public string? Name { get; set; } = "default";

        [AliasAs("a")]
        public string? Alias { get; set; }

        [FromQuery]
        public string? Q { get; set; }

        [FromServices]
        public IService Svc  { get; set; }

        public HelloApiRequest()
        {
            RuleFor(x => x.Name).NotNull().Length(2, 36);
        }
    }

如果指定了绑定来源那绑定器会自动定位来源, 如果未指定来源, 绑定器将 从 Query&Body&Head&Route等依次匹配(原有模式匹配)

vipwan commented

#14 现在支持复杂的绑定