public ConversationQueryService(iChatContext context, IUserQueryService userQueryService,
                                 ICacheService cacheService, IMapper mapper)
 {
     _context          = context;
     _userQueryService = userQueryService;
     _cacheService     = cacheService;
     _mapper           = mapper;
 }
Example #2
0
 public IndexModel(iChatContext context,
                   INotificationService notificationService,
                   IMessageParsingService messageParsingService)
 {
     _context               = context;
     _notificationService   = notificationService;
     _messageParsingService = messageParsingService;
 }
Example #3
0
 public ChannelQueryService(iChatContext context, IUserQueryService userQueryService,
                            ICacheService cacheService, IMapper mapper, INotificationService notificationService)
 {
     _context             = context;
     _userQueryService    = userQueryService;
     _cacheService        = cacheService;
     _mapper              = mapper;
     _notificationService = notificationService;
 }
Example #4
0
 public ChannelCommandService(iChatContext context, IUserQueryService userQueryService,
                              IChannelQueryService channelQueryService, INotificationService notificationService, IMessageCommandService messageCommandService)
 {
     _context               = context;
     _userQueryService      = userQueryService;
     _channelQueryService   = channelQueryService;
     _notificationService   = notificationService;
     _messageCommandService = messageCommandService;
 }
Example #5
0
 public WorkspacesController(iChatContext context, IUserQueryService userQueryService,
                             IUserCommandService userCommandService, IChannelCommandService channelCommandService,
                             IConversationCommandService conversationCommandService, IWorkspaceCommandService workspaceCommandService)
 {
     _userQueryService           = userQueryService;
     _userCommandService         = userCommandService;
     _channelCommandService      = channelCommandService;
     _conversationCommandService = conversationCommandService;
     _workspaceCommandService    = workspaceCommandService;
 }
Example #6
0
 public IdentityService(iChatContext context, IOptions <AppSettings> appSettings, IMapper mapper,
                        IUserQueryService userQueryService, IWorkspaceQueryService workspaceService, IChannelQueryService channelQueryService)
 {
     _context               = context;
     _mapper                = mapper;
     _userQueryService      = userQueryService;
     _workspaceQueryService = workspaceService;
     _appSettings           = appSettings.Value;
     _channelQueryService   = channelQueryService;
 }
Example #7
0
 public MessageQueryService(iChatContext context, IChannelQueryService channelQueryService,
                            IConversationQueryService conversationQueryService,
                            IUserQueryService userQueryService, IMapper mapper)
 {
     _context                  = context;
     _channelQueryService      = channelQueryService;
     _conversationQueryService = conversationQueryService;
     _userQueryService         = userQueryService;
     _mapper = mapper;
 }
        public void Initilize()
        {
            _context = new DbContextFactory().CreateNewContext();
            var userQueryService    = new Mock <IUserQueryService>();
            var cacheService        = new Mock <ICacheService>();
            var mapper              = new Mock <IMapper>();
            var notificationService = new Mock <INotificationService>();

            _channelQueryService = new ChannelQueryService(_context, userQueryService.Object,
                                                           cacheService.Object, mapper.Object, notificationService.Object);
        }
 public MessageCommandService(iChatContext context, IMessageParsingHelper messageParsingHelper, IFileHelper fileHelper, IChannelQueryService channelQueryService,
                              IUserQueryService userQueryService, IConversationQueryService conversationQueryService, ICacheService cacheService, INotificationService notificationService)
 {
     _context = context;
     _messageParsingHelper     = messageParsingHelper;
     _fileHelper               = fileHelper;
     _channelQueryService      = channelQueryService;
     _userQueryService         = userQueryService;
     _conversationQueryService = conversationQueryService;
     _cacheService             = cacheService;
     _notificationService      = notificationService;
 }
 public ConversationCommandService(iChatContext context, IUserQueryService userQueryService,
                                   IConversationQueryService conversationQueryService,
                                   ICacheService cacheService, INotificationService notificationService,
                                   IMessageCommandService messageCommandService)
 {
     _context                  = context;
     _userQueryService         = userQueryService;
     _conversationQueryService = conversationQueryService;
     _cacheService             = cacheService;
     _notificationService      = notificationService;
     _messageCommandService    = messageCommandService;
 }
Example #11
0
 public UserCommandService(iChatContext context, IEmailHelper emailService,
                           IUserIdenticonHelper userIdenticonHelper, IUserQueryService userQueryService,
                           ICacheService cacheService, INotificationService notificationService,
                           IConversationQueryService conversationQueryService)
 {
     _context                  = context;
     _emailService             = emailService;
     _userIdenticonHelper      = userIdenticonHelper;
     _userQueryService         = userQueryService;
     _cacheService             = cacheService;
     _notificationService      = notificationService;
     _conversationQueryService = conversationQueryService;
 }
Example #12
0
        public iChatContext CreateNewContext()
        {
            var options = new DbContextOptionsBuilder <iChatContext>()
                          .UseInMemoryDatabase(databaseName: $"test_database")
                          .Options;

            var context = new iChatContext(options);

            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            return(context); // there is no need to dispose context,
                             // it's being taken care of by .NET core
        }
Example #13
0
        public static void SeedTestData(this iChatContext context)
        {
            var user1 = context.Users.Add(new User(TestUser1Email, "testpwd", TestWorkspaceId, TestUser1Name, Guid.NewGuid()));
            var user2 = context.Users.Add(new User(TestUser2Email, "testpwd", TestWorkspaceId, TestUser2Name, Guid.NewGuid()));

            context.SaveChanges();
            TestUser1Id = user1.Entity.Id;
            TestUser2Id = user2.Entity.Id;


            var channel1 = context.Channels.Add(new Channel(TestChannel1Name, TestUser1Id, TestWorkspaceId, "topic1"));
            var channel2 = context.Channels.Add(new Channel(TestChannel2Name, TestUser2Id, TestWorkspaceId, "topic2"));

            context.SaveChanges();
            TestChannel1Id = channel1.Entity.Id;
            TestChannel2Id = channel2.Entity.Id;

            context.ChannelSubscriptions.Add(new ChannelSubscription(TestChannel1Id, TestUser1Id));

            context.SaveChanges();
        }
Example #14
0
 public FileHelper(iChatContext context, IOptions <AppSettings> appSettings)
 {
     _context     = context;
     _appSettings = appSettings.Value;
 }
Example #15
0
 public UserQueryService(iChatContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Example #16
0
 public WorkspaceQueryService(iChatContext context)
 {
     _context = context;
 }
Example #17
0
 public WorkspaceCommandService(iChatContext context)
 {
     _context = context;
 }