Skip to content

Conversation

@captainsafia
Copy link
Member

@captainsafia captainsafia commented Jun 14, 2023

  • Add trimming annotations to shared form binding code
  • Add basic support for form-binding for complex types to RDF
var app = WebApplication.Create();

app.MapPost("/", ([FromForm] Todo todo) => Results.Ok(todo));

app.Run();

record Todo(int Name, bool IsCompleted);

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jun 14, 2023
@captainsafia captainsafia force-pushed the safia/rdf-minimal-forms branch 5 times, most recently from 8562327 to 9cd1006 Compare June 14, 2023 21:45
@captainsafia captainsafia added area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-rdf and removed area-blazor Includes: Blazor, Razor Components labels Jun 14, 2023
@captainsafia captainsafia force-pushed the safia/rdf-minimal-forms branch from 9cd1006 to 723e2aa Compare June 14, 2023 22:15
@captainsafia captainsafia marked this pull request as ready for review June 14, 2023 23:52
@mitchdenny
Copy link
Member

Is RDG support coming later?

}

return BindParameterFromFormItem(parameter, formAttribute.Name ?? parameter.Name, factoryContext);
var useSimpleBinding = parameter.ParameterType == typeof(string) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: comment on why this is the criteria used for simple vs complex binding?

@captainsafia
Copy link
Member Author

Is RDG support coming later?

Yep. The meta issue for this is available at #48759. "Converter source generation" outlines the requirement to codegen implementations of the converters for the serializer that are reflection-free so that we can use them in RDG.

I've done some prototyping in this area but wanted to get this MVP out for RDF to make some movement in the space.

@mitchdenny
Copy link
Member

Gotta start somewhere. I'm a little concerned that we'll have diverging support for these kinds of features in RDF and RDG which is why I picked it up.

Copy link
Member

@adityamandaleeka adityamandaleeka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor nit comments but LGTM.

Copy link
Member

@MackinnonBuck MackinnonBuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@captainsafia captainsafia merged commit c53f18a into main Jun 16, 2023
@captainsafia captainsafia deleted the safia/rdf-minimal-forms branch June 16, 2023 16:01
@ghost ghost added this to the 8.0-preview6 milestone Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-rdf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants