Exemple #1
0
        public static async Task <int> FromDBByEMailsAsync(this UserBasicDataContainer item, string[] emails)
        {
            item.Clear();
            if (emails.Length == 0)
            {
                return(0);
            }

            List <DBQuery_User_Select_By_EMail> queries = new List <DBQuery_User_Select_By_EMail>();

            foreach (var it_email in emails)
            {
                var query = new DBQuery_User_Select_By_EMail();
                query.IN.EMail = it_email;
                queries.Add(query);
            }

            await DBThread.Instance.ReqQueryAsync(queries.ToArray());

            foreach (var it in queries)
            {
                if (it.OUT.FirstItem == null)
                {
                    continue;
                }

                item.Add(it.OUT.FirstItem);
            }

            return(item.Count);
        }
Exemple #2
0
        public static async Task <bool> FromDBByEmailAsync(this UserBasicData userBasicData, string email)
        {
            var query = new DBQuery_User_Select_By_EMail();

            query.IN.EMail = email;

            await DBThread.Instance.ReqQueryAsync(query);

            if (query.OUT.FirstItem == null)
            {
                return(false);
            }

            query.OUT.FirstItem.Copy(userBasicData);
            return(true);
        }