I need help regarding below:I am trying to design an API. For creating contracts below are the two approaches:Approach 1:public class MyController{  public void MyAction1(Dictionary<string, dynamic> input)  {    //Use input like below    //Read from input dictionary and apply minimal business logic if needed    //And Call CustomDataProvider library with input object itself(DataProvider designed in such a way that it takes Dictionary and used values as procedure input. Dictionary key is same as procedure arguments.)  }public void MyAction2(Dictionary<string, dynamic> input)  {    //Use input like below    //Read from input dictionary and apply minimal business logic if needed    //And Call CustomDataProvider library with input object itself(DataProvider designed in such a way that it takes Dictionary and used values as procedure input. Dictionary key is same as procedure arguments.)  }}In this case we don't need data contract at all.Approach 2:public class MyController{  public void MyAction1(MyContractBusinessObject1 input)  {    //Do normal business logic processing using input object and call DBProvider by creating a dictionary from business object  }public void MyAction2(MyContractBusinessObject2 input)  {    //Do normal business logic processing using input object and call DBProvider by creating a dictionary from business object  }}In this case we'll have different business classes as contract for different action inputs.Can you please suggest which of the above approaches is better and why?Let me give an example.Suppose My actions are doing login and new account creation. In first case input will be new Dictionary<string, dynamic>{{Name,myname},{Passowrd,'mypassword'}}and new Dictionary<string, dynamic>{{Name,myname},{Passowrd,'mypassword'},{Age,myage},{otherInfo,myotherinfo}}but in approach 2 input will be  class Login{    public string Name{get; set;}    public string Password{get; set;}} andclass NewAccount{public string Name{get; set;}public string Password{get; set;}public int Age{get; set;}public OtherInfo OtherInfo{get; set;}}
Correct approach for creating api contract
c#;api design