public EventController(ILogger <EventController> logger, ISessionDatabase setSessionDatabase, IEventDatabase setEventDatabase) { _logger = logger; sessionDatabase = setSessionDatabase; eventDatabase = setEventDatabase; }
static DatabaseFactory() { var db = new MemoryEventDatabase(); ScheduledEvent e = new ScheduledEvent() { Name = "Mom Birthday Party", Description = "When my mom turns 30 for the 20th time", StartDate = new DateTime(2019, 10, 21, 9, 0, 0), EndDate = new DateTime(2019, 10, 22, 9, 0, 0), IsPublic = false }; ScheduledEvent a = new ScheduledEvent() { Name = "Aunt Grace Birthday Party", Description = "Dinner at Mi Cocina", StartDate = new DateTime(2019, 7, 5, 3, 0, 0), EndDate = new DateTime(2019, 7, 6, 9, 0, 0), IsPublic = true }; db.Add(e); db.Add(a); Database = db; }
public static void Seed(this IEventDatabase source, ScheduledEvent[] events) { foreach (var scheduledEvent in events) { source.Add(scheduledEvent); } }
public ZombieEatBrainCommand( IEventBus eventBus, ISpyier spyier, IEventDatabase eventDataBase) { _eventBus = eventBus; _spyier = spyier; _eventDataBase = eventDataBase; }
public static void Seed(this IEventDatabase source) { var events = new[] { new ScheduledEvent() { Name = "QuickBook Advance", Description = "How to use QuickBook", StartDate = new DateTime(2019, 02, 12), EndDate = new DateTime(2019, 03, 13), IsPublic = true, }, new ScheduledEvent() { Name = "Michael Wedding", Description = "Important, must join", StartDate = new DateTime(2019, 01, 24), EndDate = new DateTime(2019, 01, 24), IsPublic = false, }, new ScheduledEvent() { Name = "Fundalmental I Final", Description = "Must be on time", StartDate = new DateTime(2018, 11, 30), EndDate = new DateTime(2018, 11, 30), IsPublic = false, }, new ScheduledEvent() { Name = "FBA conference", Description = "How to make money on Amazon", StartDate = new DateTime(2019, 01, 12), EndDate = new DateTime(2019, 01, 15), IsPublic = true, }, new ScheduledEvent() { Name = "Tax Training", Description = "New Tax Regulation for 2019", StartDate = new DateTime(2018, 12, 24), EndDate = new DateTime(2018, 12, 30), IsPublic = false, }, }; Seed(source, events); }
public async Task <Session[]> FindReplaysByGroup(string group, IEventDatabase eventDatabase) { return(await Task.Run(async() => { var sessionNames = await eventDatabase.FindSessionNamesByGroup(group); if (sessionNames == null || sessionNames.Length == 0) { return Array.Empty <Session>(); } List <Session> sessions = new List <Session>(); for (int i = 0; i < sessionNames.Length; i++) { if (SessionList.ContainsKey(sessionNames[i])) { sessions.Add(SessionList[sessionNames[i]]); } } return sessions.ToArray(); })); }
public OnFileEventStream(IEventDatabase eventRepository) => _eventDatabase = eventRepository;
static DatabaseFactory() { _database = new MemoryEventDatabase(); }