You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: OnTopic.AspNetCore.Mvc/README.md
+34-18Lines changed: 34 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
-
# `Ignia.Topics.AspNetCore.Mvc`
2
-
The `Ignia.Topics.AspNetCore.Mvc` assembly provides a default implementation for utilizing OnTopic with the ASP.NET Core 3.x Framework.
1
+
# OnTopic for ASP.NET Core 3.x
2
+
The `OnTopic.AspNetCore.Mvc` assembly provides a default implementation for utilizing OnTopic with the ASP.NET Core 3.x Framework. It is the recommended client for working with OnTopic.
3
+
4
+
[](https://igniasoftware.visualstudio.com/OnTopic/_packaging?_a=package&feed=46d5f49c-5e1e-47bb-8b14-43be6c719ba8&package=4db5e20c-69c6-4134-823a-c3de06d1176e&preferRelease=true)
@@ -9,19 +12,20 @@ The `Ignia.Topics.AspNetCore.Mvc` assembly provides a default implementation for
9
12
-[View Locations](#view-locations)
10
13
-[Example](#example)
11
14
-[Configuration](#configuration)
15
+
-[Dependencies](#dependencies)
12
16
-[Application](#application)
13
17
-[Route Configuration](#route-configuration)
14
18
-[Composition Root](#composition-root)
15
19
16
20
## Components
17
21
There are five key components at the heart of the ASP.NET Core implementation.
18
-
-**`TopicController`**: This is a default controller instance that can be used for _any_ topic path. It will automatically validate that the `Topic` exists, that it is not disabled (`IsDisabled`), and will honor any redirects (e.g., if the `Url` attribute is filled out). Otherwise, it will return a `TopicViewResult` based on a view model, view name, and content type.
19
-
-**`TopicViewLocationExpander`**: Assists the out-of-the-box Razor view engine in locating views associated with OnTopic, e.g. by looking in `~/Views/ContentTypes/ContentType.cshtml`, or `~/Views/ContentType/View.cshtml. See [View Locations](#view-locations) below.
22
+
-**`TopicController`**: This is a default controller instance that can be used for _any_ topic path. It will automatically validate that the `Topic` exists, that it is not disabled (`!IsDisabled`), and will honor any redirects (e.g., if the `Url` attribute is filled out). Otherwise, it will return a `TopicViewResult` based on a view model, view name, and content type.
23
+
-**`TopicViewLocationExpander`**: Assists the out-of-the-box Razor view engine in locating views associated with OnTopic, e.g. by looking in `~/Views/ContentTypes/ContentType.cshtml`, or `~/Views/ContentType/View.cshtml`. See [View Locations](#view-locations) below.
20
24
-**`TopicViewResultExecutor`**: When the `TopicController` returns a `TopicViewResult`, the `TopicViewResultExecutor` takes over and attempts to identify the correct view based on the `accept` headers, `view` query string parameter, topic's default `View` attribute and, finally, the topic's `ContentType` attribute. See [View Matching](#view-matching) below.
21
-
-**`ServiceCollectionExtensions`**: A set of extensions to be used in an ASP.NET Core website's `Startup` class that automatically handle registering services, controllers, and other extensions from `Ignia.Topics.AspNetCore.Mvc`.
22
-
-**`ITopicRepositoryExtensions`**: A set of extensions that allows loading topics based on an ASP.NET Core `RouteData` collection, including `Ignia.Topics` route variables, such as `path` and `contenttype`.
25
+
-**`ServiceCollectionExtensions`**: A set of extensions to be used in an ASP.NET Core website's `Startup` class that automatically handle registering services, controllers, and other extensions from `OnTopic.AspNetCore.Mvc`.
26
+
-**`ITopicRepositoryExtensions`**: A set of extensions that allows loading topics based on an ASP.NET Core `RouteData` collection, including `OnTopic` route variables, such as `path` and `contenttype`.
23
27
24
-
> **Note:** In [`Ignia.Topics.Web.Mvc`](../Ignia.Topics.Web.Mvc/), the `TopicViewEngine` took on the responsibilities now handled by the `TopicViewLocationExpander`, the `TopicViewResult`took on responsibilities now handled by the `TopicViewResultExecutor`, and the `MvcTopicRoutingService`took on responsibilities now handled by the`ITopicRepositoryExtensions`.
28
+
> **Note:** In [`OnTopic.Web.Mvc`](https://github.com/OnTopic/OnTopic-MVC/), the `TopicViewEngine` took on the responsibilities now handled by the `TopicViewLocationExpander`, `TopicViewResult` responsibilities for `TopicViewResultExecutor`, and the `MvcTopicRoutingService` responsibilities for`ITopicRepositoryExtensions`.
25
29
26
30
## Controllers and View Components
27
31
There are six main controllers and view components that ship with the ASP.NET Core implementation. In addition to the core **`TopicController`**, these include the following ancillary classes:
@@ -78,20 +82,32 @@ If no match is found, then the next `Accept` header will be searched. Eventually
78
82
79
83
## Configuration
80
84
85
+
### Dependencies
86
+
Installation can be performed by providing a `<PackageReference /`> to the `OnTopic.AspNetCore.Mvc`**NuGet** package.
> *Note:* This will register the `TopicViewLocationExpander`, `TopicViewResultExecutor`, as well as all [Controllers](#controllers) that ship with `Ignia.Topics.AspNetCore.Mvc`.
107
+
> *Note:* This will register the `TopicViewLocationExpander`, `TopicViewResultExecutor`, as well as all [Controllers](#controllers) that ship with `OnTopic.AspNetCore.Mvc`.
92
108
93
109
In addition, within the same `ConfigureServices()` method, you will need to establish a class that implements `IControllerActivator` and `IViewComponentActivator`, and will represent the site's _Composition Root_ for dependency injection. This will typically look like:
> *Note:* Because OnTopic relies on wildcard pathnames, a new route should be configured for every root namespace (e.g., `/Web`). While it's possible to configure OnTopic to evaluate _all_ paths, this makes it difficult to delegate control to other controllers and handlers, when necessary. As a result, it is recommended that each root container be registered individually.
134
+
>*Note:*BecauseOnTopicreliesonwildcardpathnames, anewrouteshouldbeconfiguredforeveryrootnamespace (e.g., `/Web`). Whileit's possible to configure OnTopic to evaluate _all_ paths, this makes it difficult to delegate control to other controllers and handlers, when necessary. As a result, it is recommended that each root container be registered individually.
For a complete reference template, including the ancillary controllers, view components, and a more maintainable structure, see the [`OrganizationNameActivator.cs`](https://gist.github.com/JeremyCaney/00c04b1b9f40d9743793cd45dfaaa606) Gist.
151
+
Foracompletereferencetemplate, includingtheancillarycontrollers, viewcomponents, andamoremaintainablestructure, seethe [`OrganizationNameActivator.cs`](https://gist.github.com/JeremyCaney/00c04b1b9f40d9743793cd45dfaaa606) Gist. Optionally, you may use a dependency injection container.
136
152
137
-
> *Note:* The default `TopicController` will automatically identify the current topic (based on the `RouteData`), map the current topic to a corresponding view model (based on [the `TopicMappingService` conventions](../Ignia.Topics/Mapping/)), and then return a corresponding view (based on the [view conventions](#view-conventions)). For most applications, this is enough. If custom mapping rules or additional presentation logic are needed, however, implementors can subclass `TopicController`.
Copy file name to clipboardExpand all lines: OnTopic.Data.Caching/README.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,27 @@
1
-
# `CachedTopicRepository`
2
-
The `CachedTopicRepository` provides an in-memory wrapper around an `ITopicRepository` implementation. When topics are requested, they are pulled from the cache, if they exist; otherwise, they are pulled from the underlying `ITopicRepository` implementation, and then cached. Similarly, when topics are e.g. saved, the updated versions are persisted to the underlying `ITopicRepository`, and then updated in the cache.
1
+
# OnTopic Cached Repository
2
+
The `CachedTopicRepository` provides an in-memory wrapper around an `ITopicRepository` implementation.
3
3
4
-
## Usage
4
+
[](https://igniasoftware.visualstudio.com/OnTopic/_packaging?_a=package&feed=46d5f49c-5e1e-47bb-8b14-43be6c719ba8&package=3dfb3a0a-c049-407d-959e-546f714dcd0f&preferRelease=true)
When topics are requested, they are pulled from the cache, if they exist; otherwise, they are pulled from the underlying `ITopicRepository` implementation, and then cached. Similarly, when topics are e.g. saved, the updated versions are persisted to the underlying `ITopicRepository`, and then updated in the cache.
9
+
10
+
## Installation
11
+
Installation can be performed by providing a `<PackageReference /`> to the `OnTopic.Data.Caching`**NuGet** package.
Copy file name to clipboardExpand all lines: OnTopic.Data.Sql.Database/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# SQL Schema
2
-
The `Ignia.Topics.Data.Sql.Database` provides a default schema for supporting the [`SqlTopicRepository`](../Ignia.Topics.Data.Sql).
2
+
The `OnTopic.Data.Sql.Database` provides a default schema for supporting the [`SqlTopicRepository`](../OnTopic.Data.Sql).
3
3
4
4
> *Note:* Not all SQL objects are documented here. Missing objects are primarily intended for infrastructure support and used exclusively by stored procedures or administrators.
The `SqlTopicRepository` provides an implementation of the `ITopicRepository` interface for use with Microsoft SQL Server. All requests are sent to the database, with no effort to cache data.
3
3
4
-
> *Note:* The schema for the Microsoft SQL Server implementation can be found at [`Ignia.Topics.Data.Sql.Database`](../Ignia.Topics.Data.Sql.Database). It is not currently distributed as part of the `SqlTopicRepository` and must be deployed separately.
4
+
[](https://igniasoftware.visualstudio.com/OnTopic/_packaging?_a=package&feed=46d5f49c-5e1e-47bb-8b14-43be6c719ba8&package=15c8a666-efa5-4b23-b08b-1de907478d2d&preferRelease=true)
> *Note:* The schema for the Microsoft SQL Server implementation can be found at [`OnTopic.Data.Sql.Database`](../OnTopic.Data.Sql.Database/README.md). It is not currently distributed as part of the `SqlTopicRepository` and must be deployed separately.
8
+
9
+
## Installation
10
+
Installation can be performed by providing a `<PackageReference /`> to the `OnTopic.Data.Sql`**NuGet** package.
> *Note:* In real-world applications, it is recommended that the `SqlTopicRepository` be wrapped by the [`CachedTopicRepository`](../Ignia.Topics.Data.Caching), which provides an in-memory cache of any `ITopicRepository` implementation.
27
+
> *Note:* In real-world applications, it is recommended that the `SqlTopicRepository` be wrapped by the [`CachedTopicRepository`](../OnTopic.Data.Caching/README.md), which provides an in-memory cache of any `ITopicRepository` implementation.
Provides common test doubles for use in testing the **OnTopic Library**.
3
+
4
+
[](https://igniasoftware.visualstudio.com/OnTopic/_packaging?_a=package&feed=46d5f49c-5e1e-47bb-8b14-43be6c719ba8&package=3a741b7a-7fa1-4bdb-bc55-efbac3f04e6c&preferRelease=true)
> *Note:* This package is currently only available on Ignia's private **NuGet** repository. For access, please contact [Ignia](http://www.ignia.com/).
19
+
20
+
## Inventory
21
+
22
+
### Dummies
23
+
Dummies provide no actual functionality and are not expected to function correctly if called. They are simply provided to satisfy the inferface requirement of dependencies, so that a service can be constructed.
Stubs not only satisfy the interface, but will return canned data that tests can operate against, thus allowing unit tests to interact with predetermined scenarios against the service.
0 commit comments