标签:cti 自己 strong 匿名类 each query 需要 cot enum
连续两次被相同问题困扰。
一、举例
var query=db.StudentScore.Where(r=> r.SubjectId==subjectId).Select(g=>
new
{SubjectId=SubjectId,Score=g.Score}).ToList();
var query=db.StudentScore.Where(r=> r.SubjectId==subjectId).Select(g=>
new StudentScore
{SubjectId=SubjectId,Score=g.Score}).ToList();
var query=db.StudentScore.Where(r=> r.SubjectId==subjectId).Select(g=>
new StudentScoreTemp
{SubjectId=SubjectId,Score=g.Score}).ToList();
var query=db.StudentScore.Where(r=> r.SubjectId==subjectId).Select(g=>g
).ToList();
//1)查询SqlQuery
result.slList = db.Database.SqlQuery<DataTemp>("select Precision,Year,LandCover, sum(Area) as Area from [EcoTypes] where LandCover=@type group by Precision, Year, LandCover", new SqlParameter("@type", "森林")).Select(d=> d.Area).ToList();
//2)增删改:ExecuteSqlCommand
db.Database.ExecuteSqlCommand("").ToString();
标签:cti 自己 strong 匿名类 each query 需要 cot enum
原文地址:https://www.cnblogs.com/hao-1234-1234/p/9112434.html