Beispiel #1
0
        public async Task <bool> IsEmailAlreadyRegistered(string email)
        {
            bool isRegistered = true;
            var  filter       = Builders <UserModel> .Filter.Eq(x => x.Email, email);

            var user = (await _collection.FindAsync <UserModel>(filter)).FirstOrDefault();;

            if (WOW.IsNull(user))
            {
                isRegistered = false;
            }
            return(isRegistered);
        }
Beispiel #2
0
        public async Task <UserEntity> Authenticate(string Email, string Password)
        {
            if (String.IsNullOrWhiteSpace(Email) || String.IsNullOrWhiteSpace(Password))
            {
                throw new ArgumentNullException();
            }

            UserEntity entities = null;
            var        model    = await _userRepository.Authenticate(Email, Password);

            if (!WOW.IsNull(model))
            {
                entities = _mapper.Map <UserEntity>(model);
            }
            return(entities);
        }
Beispiel #3
0
        public async Task <UserModel> Authenticate(string email, string password)
        {
            UserModel model  = null;
            var       filter = Builders <UserModel> .Filter.Eq(x => x.Email, email);

            var user = (await _collection.FindAsync <UserModel>(filter)).FirstOrDefault();;

            if (!WOW.IsNull(user))
            {
                if (user.Password == password)
                {
                    model = user;
                }
            }
            return(model);
        }
Beispiel #4
0
        static void Main()
        {
            Console.WriteLine("Seasons\n");
            for (Seasons s = Seasons.Season; s <= Seasons.Season3; s++)
            {
                Console.WriteLine(s);
            }
            Console.WriteLine("BRAT\n");

            for (Brat b = Brat.brat; b <= Brat.brat4; b++)
            {
                Console.WriteLine(b);
            }

            for (Meow meow = Meow.meow; meow <= Meow.Meow; meow++)
            {
                Console.WriteLine(meow);
            }

            for (WOW WOW = WOW.WOW; WOW <= WOW.W0W; WOW++)
            {
                Console.WriteLine(WOW);
            }

            for (Groups group = Groups.PKS115; group <= Groups.PKS315; group++)
            {
                Console.WriteLine(group);
            }

            Test MyStruct_obj = new Test();

            MyStruct_obj.a = 2;
            MyStruct_obj.p = 2.5;
            MyStruct_obj.b = 5;

            MyStruct_obj.Show();
        }