Created
January 13, 2014 16:38
-
-
Save BartDM/8403394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace LuceneWrapper.TestApp | |
{ | |
public class PersonWriter : BaseWriter | |
{ | |
public PersonWriter(string dataFolder) | |
: base(dataFolder) | |
{ | |
} | |
public void AddUpdatePersonToIndex(Person person) | |
{ | |
AddUpdateItemsToIndex(new List<PersonDocument> { (PersonDocument)person }); | |
} | |
public void AddUpdatePeopleToIndex(List<Person> people) | |
{ | |
AddUpdateItemsToIndex(people.Select(p => (PersonDocument)p).ToList()); | |
} | |
public void DeletePersonFromIndex(Person person) | |
{ | |
DeleteItemsFromIndex(new List<PersonDocument> { (PersonDocument)person }); | |
} | |
public void DeletePersonFromIndex(int id) | |
{ | |
DeleteItemsFromIndex(new List<PersonDocument> { new PersonDocument { Id = id } }); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment