예제 #1
0
        public async Task AddCalendarEntry(Guid server, DateTime firstRun, Periodicity periodicity, IEnumerable <string> items)
        {
            var entry = new DBCalendarEntry {
                Server = server, FirstRun = firstRun, Periodicity = periodicity, Values = new int[] { }, Items = items
            };

            entry.UpdateNextRun();
            await dataBase.AddCalendarEntry(entry);
        }
예제 #2
0
        public async Task <Guid> AddCalendarEntry(DBCalendarEntry entry)
        {
            if (entry.Id == Guid.Empty)
            {
                entry.Id = Guid.NewGuid();
            }
            await TblCalendarEntry.Insert(entry, false).ExecuteAsync().ConfigureAwait(false);

            return(entry.Id);
        }
예제 #3
0
        public async Task <IActionResult> Post([FromBody] DBCalendarEntry calEntry)
        {
            calEntry.Id = await metaDB.AddCalendarEntry(calEntry);

            return(Ok(calEntry));
        }