public async Task <IActionResult> GetLogin([FromQuery] string login) { if (login == "") { ErrorViewModel.IsEmptyUser(); } var isLogin = await db.Users.FirstOrDefaultAsync(l => l.Login == login); if (isLogin != null) { ErrorViewModel.LoginNotEmpty(); } return(Ok("Логин свободен.")); }