// List<UserInfo> jobInfoList = JsonSerializer.Deserialize<List<UserInfo>>(searchTerm);//将字符转化为List
var testType = JsonSerializer.Deserialize(searchTerm);
解决Json中文编码问题:
return JsonSerializer.Serialize(linqs,
options: new System.Text.Json.JsonSerializerOptions
{
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
}
);
//使用EFcore 执行sql语句
return _userInfoContext.UserInfos .FromSqlRaw("SELECT * FROM View_UserInfo ").ToList();