Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (var session = DocumentStoreHolder.Store.OpenSession())
- {
- //This list is used to put in the database -- Careful!!!
- List<classA> List_01 = new List<classA>();
- //This list is from database, used to compare with the new coming data.
- //We will check with the list got from data.
- List<ClassA> List_02 = session.Query<classA>().ToList();
- //This uses the method Except to remove the duplicates between the new data
- //and the current list of matches in database.Return data is the new match
- //that is not existing in DB
- List_01 = List_02.Except(List_00, new IdComparer()).ToList();
- foreach (classA data in List_01)
- {
- //Why does it not store data in DB?!?!?!?!?
- session.Store(_match);
- }
- session.SaveChanges();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement