Пример #1
0
        public async Task <MessageGroup> CreateNewGroup(MessageGroup messageGroup)
        {
            messageGroup.TextMessages.Clear();
            await _bSChatDBContext.MessageGroup.AddAsync(messageGroup);

            await _bSChatDBContext.SaveChangesAsync();

            return(messageGroup);
        }
Пример #2
0
        public async Task SignUp(Person person)
        {
            if (person != null)
            {
                await _bSChatDBContext.Person.AddAsync(person);

                await _bSChatDBContext.SaveChangesAsync();
            }
        }
Пример #3
0
        public async Task <bool> SignUp(Person person)
        {
            bool isSuccess  = false;
            bool emailExist = false;

            if (await _bSChatDBContext.Person.AnyAsync(p => p.Mail.ToLower() == person.Mail.ToLower()))
            {
                emailExist = true;
            }

            if (person != null && !emailExist)
            {
                await _bSChatDBContext.Person.AddAsync(person);

                await _bSChatDBContext.SaveChangesAsync();

                isSuccess = true;
            }
            return(isSuccess);
        }