小编Ara*_*ash的帖子

如何使用较少的方法参数

我在这个方法中根据这些参数在表中搜索我的数据.

public List<Product_tbl> GET_Product(int? ProductID = null, string Name= null, bool? MakeFlag= null, string Color= null)
{
   ...
}
Run Code Online (Sandbox Code Playgroud)

我知道我应该尽可能少地争论方法,所以有什么方法可以编写我的代码清理并使用较少的参数来处理这种方法.

c# methods arguments

0
推荐指数
1
解决办法
108
查看次数

标签 统计

arguments ×1

c# ×1

methods ×1