コード例 #1
0
        private bool IsNeedSave()
        {
            var isNeedSave = false;

            if (!NewCollection.IsNullOrEmpty() ||
                !ModifiedCollection.IsNullOrEmpty() ||
                !DeletedCollection.IsNullOrEmpty())
            {
                isNeedSave = true;
            }
            return(isNeedSave);
        }
コード例 #2
0
            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);
            }
コード例 #3
0
        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;
            }
        }