0
点赞
收藏
分享

微信扫一扫

C#_接收前台数组并转换成带双引号的数据,拼接t-sql的where in 条件


前台数据

["One","Two","Three"]

controller =>

HttpPost(
  "get_employee_activity_type")]
 
 
ProducesResponseType(
  typeof(
  IEnumerable<
  EmployeeAssignmentsViewModel>), (
  int)
  HttpStatusCode.
  OK)]
 
 
public 
  async 
  Task<
  IActionResult> 
  GetEmployeeActivityType([
  FromBody]
  List<
  string> operatorIds)


Queries(Services)

public 
 async 
 Task<
 IEnumerable<
 EmployeeAssignmentsViewModel>> 
 GetEmployeeActivityTypeAsync(
 List<
 string> operatorIds)

string operatorIdWhere 
 = 
 String.
 Join(
 "','", 
 operatorIds);


因为我要的数据格式要成 'One','Two','Three'的


昨个脑卡。。一直没想出来。。。。。基础啊

举报

相关推荐

0 条评论