public IndexingTask(IContentManager contentManager, IndexingTaskRecord record) { // in spite of appearances, this is actually a created class, not IoC, // but dependencies are passed in for lazy initialization purposes _contentManager = contentManager; _record = record; }
private void CreateTask(ContentItem contentItem, int action) { if ( contentItem == null ) { throw new ArgumentNullException("contentItem"); } var taskRecord = new IndexingTaskRecord { CreatedUtc = _clock.UtcNow, ContentItemRecord = contentItem.Record, Action = action }; _repository.Create(taskRecord); }
private void CreateTask(ContentItem contentItem, int action) { if ( contentItem == null ) { throw new ArgumentNullException("contentItem"); } foreach (var task in _repository.Table.Where(task => task.ContentItemRecord == contentItem.Record)) { _repository.Delete(task); } var taskRecord = new IndexingTaskRecord { CreatedUtc = _clock.UtcNow, ContentItemRecord = contentItem.Record, Action = action }; _repository.Create(taskRecord); }
private void CreateTask(ContentItem contentItem, int action) { if (contentItem == null) { throw new ArgumentNullException("contentItem"); } if (contentItem.Record == null) { // ignore that case, when Update is called on a content item which has not be "created" yet return; } foreach (var task in _repository.Fetch(task => task.ContentItemRecord == contentItem.Record)) { _repository.Delete(task); } var taskRecord = new IndexingTaskRecord { CreatedUtc = _clock.UtcNow, ContentItemRecord = contentItem.Record, Action = action }; _repository.Create(taskRecord); }