private bool IsNeedSave() { var isNeedSave = false; if (!NewCollection.IsNullOrEmpty() || !ModifiedCollection.IsNullOrEmpty() || !DeletedCollection.IsNullOrEmpty()) { isNeedSave = true; } return(isNeedSave); }
public bool Equals(ModifiedCollection other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase) && Count == other.Count && LastDocumentChangeVector == other.LastDocumentChangeVector); }
public override void Commit() { if (!Committed) { var newList = NewCollection.Select(pre => pre.Value).ToList(); var modifiedList = ModifiedCollection.Select(pre => pre.Value).ToList(); var deleteList = DeletedCollection.Select(pre => pre.Value).ToList(); localPersistenceDAL.Value.PersistenceToDatabase(newList, modifiedList, deleteList); //执行事务操作。 Committed = true; } }