Table of Contents

C# ServiceKits (v14)

you are here (click to zoom) - discover the stack

ServiceKits help you get a Service with fewer lines of code. The Kit is provided on the Kit property.

For example, you may need to call the IPageService Activate. With the v14 API it looks like this:

@Kit.Page.Activate("turnOn")

The Kit Property

The Kit property is available on all of your code which inherits from any one of these:

  • Custom.Hybrid.Api14 for Web APIs
  • Custom.Hybrid.Code14 for custom code
  • Custom.Hybrid.Razor14 for Razor

The Kit in all ...14 base classes will always be a ServiceKit14.

They are...

  • lazy so they are only created if ever needed
  • created and preserved so multiple access to the service won't cause any overhead
  • versioned so that we can continue to enhance the APIs without breaking existing Razor

Services in the ServiceKit

This will depend on the ServiceKit you will use.

In v14, the Kit will then always be a ServiceKit14. You can read about the included servicen in those docs.

History of Dependency Injection in 2sxc

  1. 2sxc introduced Dependency Injection 1.1 in v9 (May 2017)
  2. Integrated with Oqtane DI in v12 (May 2021)
  3. GetService<T> pattern introduced for Razor/C# in v12 (May 2021)
  4. Integrated with Oqtane DI in v12 (May. 2021)
  5. Upgraded to Dependency Injection 2.1 in v13 (Dec. 2021)
  6. Integrated with Dnn DI in v13 (Dec. 2021)
  7. Created ServiceKits for v14 (June 2022)
  8. Added ServiceKitLight for custom DataSources in 2sxc 15
  9. Added ServiceKit16 for 2sxc 16