public void SaveYearRecruits(IEnumerable <RecruitViewModel> models) { _yearRecruitsRepository.DeleteMany(x => true); var docs = models.Select(model => new YearRecruit { Content = JsonConvert.SerializeObject(model) }); _yearRecruitsRepository.InsertMany(docs.ToList()); }
public void SaveNoteCategories(IEnumerable <NoteCategoryViewModel> models) { _noteCategoriesRepository.DeleteMany(x => true); var docs = models.Select(model => new NoteCategories { Content = JsonConvert.SerializeObject(model) }); _noteCategoriesRepository.InsertMany(docs.ToList()); }
/// <summary> /// Deletes the many. /// </summary> /// <typeparam name="TDocument">The type of the document.</typeparam> /// <param name="filter">The filter.</param> public void DeleteMany <TDocument>(Action <IFilterBuilder <TDocument> > filter) where TDocument : IDocument { _mongoRepository.DeleteMany <TDocument>(filter); }
public void CleanTermNotes() => _termNotesRepository.DeleteMany(x => true);
public async Task RemoveManybyCollectionId(Guid collectionId) => await _repository.DeleteMany(p => p.CollectionId == collectionId);