Dapper.NET Using a template object


Example

You can use an instance of an object to form your parameters

public class SearchParameters {
  public string SearchString { get; set; }
  public int Page { get; set; }
}

var template= new SearchParameters {
  SearchString = "Dapper",
  Page = 1
};

var p = new DynamicParameters(template);

You can also use an anonymous object or a Dictionary