0

If i have a rest api with a GET endpoint such as

\users

i also have a UserSearchModel class for example

public class UserSearchModel
{
  public string firstName {get;set;}
  public string lastName {get;set;}
  public string userCode {get;set;}
}

is it possible to have a controller action such as

public async... GetUsers(UserSearchModel searchParams) 

without sending the data in request body, if i send in query string instead will the model binding still work?

1

1 Answer 1

1

If you send each properties as a query string yes

http://example.com/url?firstName=madu&lastName=Alikor&usercode=123
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.