项目中,在获取json数据转换为list类型以后,本来以为可以直接使用,结果在使用中报错“java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.XX”,搜索后发现是在转换成list时,list类型是LinkedHashMap而不是我需要的对象,Jackson在转换时按照标准行为将数据以List<LinkedHashMap> 返回,而不是作为 List<SomeObject> 返回,但是
using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Reflection; using System.Web; using WebSite.Models; namespace testWebuploader.Scripts.Plugin.webuploader_v0._1._2 { /// <summary> /
public async Task<IEnumerable<QuestionAllInfo>> GetAllQuestionByTypeIdAsync(int id) { string sql = "SELECT q.Id as questionId,i.Id as instanceId,q.name as questionName,q.Intention as questionIntention,i.`Name` as instancesName FROM `t_que