logo
  • 教程列表
  • SO官方文档
  • 动态参数
    • 基本用法
    • Dapper 中的动态参数
    • 使用模板对象
  1. StackOverflow 文档
  2. Dapper.NET 教程
  3. 动态参数
  4. 使用模板对象

使用模板对象

Created: November-22, 2018

你可以使用对象的实例来形成参数

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);

你还可以使用匿名对象或 Dictionary

  • Dapper 中的动态参数

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明