public async Task <IActionResult> GetEmail([FromQuery] string email) { if (email == "") { ErrorViewModel.IsEmptyEmail(); } var isEmail = await db.Users.FirstOrDefaultAsync(e => e.Email == email); if (isEmail != null) { ErrorViewModel.EmailNotEmpty(); } return(Ok("email свободен.")); }