我想在一个条件最初使用一个模型(列表)声明的条件中使用一个列表变量,但我想分配另一个模型(列表)
List<Teacher> list;
if (WebConfigurationManager.AppSettings["ReadData"] == "True")
{
list = answer.Where(x => x.Study.Contains(Name)).ToList();
}
else
{
answer = client.CreateDocumentQuery<Student>(
list = answer.Where(x => x.Study.Contains(Name)).ToList();
}
> Getting error in else part- can not implicit convert type
> ..list<Teacher> to List<student>...