public ActionResult <IEnumerable <UserInfo> > shopTow() { var Rather = new List <UserInfo>(); using (SqlConnection connection = new SqlConnection(_connectionString)) { SqlCommand command = new SqlCommand($"select * from Goods a join GoodsType b on a.Id=b.TypeParentid where b.TypeName='男装'", connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { Rather.Add(HelpTool.ADONetToClass <UserInfo>(reader)); } } return(Ok(Rather)); }
public ActionResult <IEnumerable <UserInfo> > shopOne() { var Rather = new List <UserInfo>(); using (SqlConnection connection = new SqlConnection(_connectionString)) { SqlCommand command = new SqlCommand($"select * from UserInfo where sex='女'", connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { Rather.Add(HelpTool.ADONetToClass <UserInfo>(reader)); } } return(Ok(Rather)); }