Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 1.91 KB

README.md

File metadata and controls

30 lines (25 loc) · 1.91 KB

OnTopic SQL Repository

The SqlTopicRepository provides an implementation of the ITopicRepository interface for use with Microsoft SQL Server. All requests are sent directly to the database, with no effort to first retrieve the data from, or subsequently store the data in, a local cache.

OnTopic.Data.Sql package in Internal feed in Azure Artifacts Build Status NuGet Deployment Status

Note: The schema for the Microsoft SQL Server implementation can be found at OnTopic.Data.Sql.Database. It is not currently distributed as part of the SqlTopicRepository and must be deployed separately.

Contents

Installation

Installation can be performed by providing a <PackageReference /> to the OnTopic.Data.Sql NuGet package.

<Project Sdk="Microsoft.NET.Sdk.Web">
  …
  <ItemGroup>
    <PackageReference Include="OnTopic.Data.Sql" Version="5.0.0" />
  </ItemGroup>
</Project>

Usage

var sqlTopicRepository = new SqlTopicRepository(connectionString);
var rootTopic = sqlTopicRepository.Load();

Note: In real-world applications, it is recommended that the SqlTopicRepository be wrapped by the CachedTopicRepository, which provides an in-memory cache of any ITopicRepository implementation.