如下代码所示,API 会两次命中数据库,执行两次 Linq 查询。我不能通过只点击数据库一次来执行下面显示的操作吗?
var IsMailIdAlreadyExist = _Context.UserProfile.Any(e => e.Email == myModelUserProfile.Email);
var IsUserNameAlreadyExist = _Context.UserProfile.Any(x => x.Username == myModelUserProfile.Username);