コード例 #1
0
        public void PrepareData(EventsContext context, IEnumerable <DomainEvent> events)
        {
            if (events != null && events.Count() > 0)
            {
                var eventsWrapped = events.Select(ev => EventWrapper.Wrap(ev)).ToArray();
                context.AddRange(eventsWrapped);

                context.SaveChanges();
            }
        }
コード例 #2
0
        public async Task AddToDb(EventCallbackModel eventCallback)
        {
            foreach (EventModel em in eventCallback.events)
            {
                if (em.objectType == "cell")
                {
                    em.cellValue = _smartsheetService.GetCellValue(eventCallback.scopeObjectId, em.rowId.Value, em.columnId.Value);
                }
            }

            _context.AddRange(eventCallback);
            await _context.SaveChangesAsync();
        }