MonoKit.Domain.SQLite.SqlAggregateManifestRepository.DoUpdate C# (CSharp) Method

DoUpdate() private method

private DoUpdate ( System.Guid aggregateId, int currentVersion, int newVersion ) : bool
aggregateId System.Guid
currentVersion int
newVersion int
return bool
        private bool DoUpdate(Guid aggregateId, int currentVersion, int newVersion)
        {
            if (currentVersion == 0)
            {
                this.connection.Insert(new AggregateManifest { Identity = aggregateId, Version = newVersion, });
            }
            else
            {
                var rows = this.connection.Execute(UpdateSql, newVersion, aggregateId, currentVersion);
                return rows == 1;
            }

            return true;
        }