コード例 #1
0
ファイル: UserController.cs プロジェクト: MarinTerentiev/mag
		public IHttpActionResult ExistData(UserExists dealerExists)
		{
			var exist = false;
			var message = string.Empty;

			var existUserName = _userService.ExistUserName(dealerExists.UserName);
			if (existUserName)
			{
				exist = true;
				message += "Login is exist.<br>";
			}

			var existEmail = _userService.ExistEmail(dealerExists.Email);
			if (existEmail)
			{
				exist = true;
				message += "Email is exist.<br>";
			}


			return Ok(new
			{
				data = new
				{
					exist,
					message
				}
			});
		}
コード例 #2
0
 public async Task <bool> Handle(UserExists request, CancellationToken cancellationToken)
 {
     return(await _dbContext
            .Users
            .AsNoTracking()
            .AnyAsync(user => user.UserId == request.UserId));
 }
コード例 #3
0
 public async Task <ActionResult <bool> > GetUser(string id, string pw)
 {
     if (await UserExists.Run(id, pw, _context))
     {
         return(true);
     }
     return(false);
 }
コード例 #4
0
 public async Task <ActionResult <List <Homework> > > PostHomework([Bind("id,pw")] auth user)
 {
     if (await UserExists.Run(user.id, user.pw, userDB))
     {
         GetHomeworks a = new GetHomeworks(_context, userDB, noteCatDB, userCatDB, noteClassDB, user.id);
         DelHomeworks();
         return(await a.Run());
     }
     return(null);
 }
コード例 #5
0
        public IActionResult UserExists([FromQuery] UserExists model)
        {
            var result = _unitOfWork.UserExists(model);

            if (result)
            {
                return(Ok());
            }

            return(NotFound());
        }
コード例 #6
0
        public async Task <ActionResult <List <SelectedCategory> > > PostCategory([Bind("id,pw")] auth user)
        {
            int no = await UserExists.RunNo(user.id, user.pw, userDB);

            if (no != 0)
            {
                var a = from b in await _context.SelectedCategories.ToListAsync()
                            where b.CatUName == no
                        select b;

                return(a.ToList());
            }
            return(null);
        }
コード例 #7
0
 public bool UserExists(UserExists model)
 {
     return(UserRepository
            .Entities
            .Any(co => co.Email == model.Email || co.UserName == model.Email));
 }
コード例 #8
0
 public bool Handle(UserExists query) =>
 _archDbContext.Users.Any(x => x.Username == query.UserName);
コード例 #9
0
 public bool Handle(UserExists query) =>
 _authRepository.Any(_ => _.Username == query.UserName);