v4.3.0
This update provides backend functionality and bug fixes to improve performance and reliability, with a particular emphasis on importing and saving large topic graphs. The OnTopic library can now connect to empty databases, and persist in-memory topic graphs to them. To do this, it dynamically identifies content type and attribute descriptors from that topic graph. Further, when recursively saving topic graphs, there are significant performance improvements—while simultaneously fixing bugs that can occur when there are mismatches between the configuration of the saved and in-memory schemas.
Functionality
ContentTypeDescriptors (a9ea634) andAttributeDescriptors (b0c5a5e) are now updated dynamically when saved, and thus configuration changes are now available immediately without requiring an application restart (fb3366e).- The byline (
LastModifiedBy) and dateline (LastModified) are now only persisted to the underlying topic repository if any other attributes (d8d41b7) or relationships (8caa148) have changed (d8d41b7). - Arbitrary attributes (i.e., attributes not defined in the
ContentTypeDescriptor) can now be programmatically added (c3c01ef), modified, or deleted (2151a08) via the OnTopic Library (8b7dffe). - Empty databases can now be connected to without throwing exceptions, thus allowing a reference schema can be
Import()ed via the OnTopic Data Transfer library using the OnTopic Editor (695664d). TopicRepository.Save()will now loop back and save any topics with previously unresolved (i.e., unsaved) references (including relationships orDerivedTopic) (913b68d).UpdateRelationshipsnow synchronizes relationships, instead of just inserting them. It accepts an optional@DeleteUnmatchedargument which can be disabled to append new relationships, instead of also deleting unmatched relationships (cbba817).
Bug Fixes
- Fixed a bug where topics from the previous relationship were saved to each subsequent relationship for a topic (27d9bfe).
- Fixed a bug where attributes that had been reconfigured away from
IsIndexedAttribute, but not otherwise changed, would be orphaned (7a61005) deleted (d64d242) onSave(). - Fixed a bug where an off-target exception would be thrown if
SqlTopicRepository.Load(string topicKey)wasn't able to identify a matching topic (c97dcb3). - Fixed a bug where unsaved relationships (6da3fa4) and derived topics (a3b6da1) were saving
-1to the database if they referenced unsaved topics.
Code Changes
Performance
- Reduced execution time of
UpdateTopicby 50% through optimization of queries (fae0e8d). SqlTopicRepository.Save()will only save topics which have actually changed; this greatly increases the performance of recursive saves when merging large topic graphs (afa1e9b).
API Changes
- Introduced
AttributeValuesDataTable(313fe71) andTopicListDataTable(7a37dc9) to encapsulate the corresponding user-defined, table-valued types in SQL, and extendedSqlCommand.AddParameter()to support them (0cd2506). - Introduced
TopicNotFoundException(2300e69), which derives fromTopicRepositoryExceptionand is used inITopicRepository.Load(). - Introduced
TopicRepositoryBase.GetContentTypeDescriptor()convenience method (408d01a) for loading aContentTypeDescriptor—either from the database, or from the local topic graph. - Introduced
TopicRepositoryBase.GetAttributes()method for retrieving extended or indexed attributes, optionally filtered byIsDirty(120c55e). - Introduced
Topic.GetTopicByUniqueKey()(867b110) andTopic.GetRootTopic()(0bddfb0) extension methods toOnTopic.Queryablenamespace (d18984d). - Introduced
Topic.IsNewproperty for tracking whether a topic is new, or if it has been persisted to the database (1678523, f046179). - Introduced a
NamedTopicCollection.IsDirtyproperty (4762694),RelatedTopicCollection.IsDirty()(2adef58), andAttributeValueCollection.IsDirty()(d3b49ff) for tracking if any relationships or attributes have changed (afa1e9b). - Removed legacy
SqlTopicRepository.CreateRelationshipsXml()private helper function, as that functionality is no longer used (7bea7d3).
General
- Migrated to C# 8.0's new block-level
usingstatement, in favor of placing explicitDispose()calls infinallyblocks (f85aab2) - Migrated to GitVersion's
ContinuousDeploymentmode for all branches exceptmasterto simplify version incrementing on feature branches (b4105f3).