2

I just upgraded my project from ServiceStack 5.1 to 5.5.1. Now where I am using TemplateContext from ServiceStack.Templates it tells instead to use TemplateContext. Needless to say, this is likely a mistake in the description for the Obsolete attribute. What is the appropiate replacement for TemplateContext now in ServiceStack 5.5.1?

enter image description here

arjabbar
  • 6,044
  • 4
  • 30
  • 46

1 Answers1

1

The depreciation message should’ve said to use ScriptContext instead.

In the latest ServiceStack v5.5 Release ServiceStack Templates has been rebranded to #Script.

The section on Migration to new Script API's explains how to migrate in more detail:

Migrating to the new APIs is fairly straight forward:

  • Change using ServiceStack.Templates; to using ServiceStack.Script;
  • Any classes with TemplatePage* has been renamed to SharpPage*
  • Any other class with a Template* prefix has been renamed to Script*

This change doesn’t affect any of your existing #Script source code whose existing syntax and available filters/methods remains unchanged.

New Terminology

The primary rationale for the rebranding was so we’re better able to label, describe and document all of #Script different features easier, so when referring to Templates View Engine we’re now calling Sharp Pages which is a better corollary to “Razor Pages” which it provides an alternative to.

Other re-branded features:

The collection of methods you inject in your scripts like TemplateRedisFilters and TemplateDbFilters are now referred to as “Scripts” where they’ve been renamed to RedisScripts and DbScripts.

mythz
  • 141,670
  • 29
  • 246
  • 390