把类型转为可空类型,如下例:
int? max = (from t in db.Tags where t.ParentId == request.TargetId select (int?) t.SortOrder).Max(); if (!max.HasValue) max = 1; else max += 1;
Powered by: 博客园 Copyright © 2024 marcozh Powered by .NET 9.0 on Kubernetes