long? maxCount = db.Database.SqlQuery<nullabled<long>>("select max(id) from [Student]").FirstOrDefault();
if(maxCount !=null)
maxid = maxCount;
maxid ++;
标签:FirstOrDefault,maxid,33,sql,linq,maxCount,主键
来源: https://www.cnblogs.com/sweettie/p/15046933.html