Parent / child editing with Editor In .NET Syntax
Parent / child editing with Editor In .NET Syntax

What is the syntax in C# .NET for the following filter?
if ( ! isset($_POST['site']) || ! is_numeric($_POST['site']) ) {
echo json_encode( [ "data" => [] ] );
}
else {
Editor::inst( $db, 'users' )
->field(
Field::inst( 'users.first_name' ),
Field::inst( 'users.last_name' ),
Field::inst( 'users.phone' ),
Field::inst( 'users.site' )
->options( 'sites', 'id', 'name' )
->validator( 'Validate::dbValues' ),
Field::inst( 'sites.name' )
)
->leftJoin( 'sites', 'sites.id', '=', 'users.site' )
->where( 'site', $_POST['site'] )
->process($_POST)
->json();
}
more info here: https://datatables.net/blog/2016-03-25
THANKS!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It is very similar:
See the .NET documentation for more details. You might also want to add the wrapper
if
condition withrequest.Form.AllKeys.Contains("site")
.Regards,
Allan