Skip to content

Instantly share code, notes, and snippets.

@BartDM
Created January 13, 2014 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BartDM/8403394 to your computer and use it in GitHub Desktop.
Save BartDM/8403394 to your computer and use it in GitHub Desktop.
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