예제 #1
0
        public override void Seed()
        {
            if (_chatUserStore.Any() || !_chatUserRepository.Any())
            {
                return;
            }

            var chatUsers = _chatUserRepository.GetAll();
            var author    = chatUsers.First().User;

            foreach (var chatUser in chatUsers)
            {
                _chatUserStore.Add(new ChatUser(chatUser.UserId, chatUser.ChatId));

                var group = _groupRepository.Get(chatUser.Chat.GroupId);
                _chatEventService.AddUserAddedToChatEvent(group, author, chatUser.User, chatUser.Chat);
            }
        }