LookUp Engine
The LookUp Engine is responsible for getting values. It will use LookUp sources to resolve the values.
- The LookUp System is in the ToSic.Eav.LookUp namespace
- The LookUp Engine is an ILookUpEngine
Warning
This is very technical stuff, you usually don't need to know this. We're just including it for completeness sake.
LookUpEngine
LookUp Engines will collect a set of LookUp objects and use these to resolve strings like Module:ModuleId
. For this, they will check which LookUp has the right name (in this case Module
) and will ask it if it can provide the value (in this case the ModuleId
).
Notes
Usually LookUp Engines will receive a long list (Dictionary) of things to look up, and resolve these in one quick call. This is because often they are attached to a DataSource which requires many configuration values - so they will prepare the list of parameters, pass it to the LookUpEngine and then work with the results as needed.
Tip
LookUp Engines can also perform default-fallbacks - so if a LookUp source can't provide the answer needed, the engine may use a static value instead:
[QueryString:PageSize||10]
Tip
LookUp Engines can also perform lookup-fallbacks if the source can't provide an answer. In this case it may ask another LookUp if it has the answer. This happens when the Token looks like this:
[QueryString:PageSize||[App:Settings:PageSize]]
C# and Dependency Injection
LookUp Engines all implement the ILookUpEngine interface and should inherit the LookUpEngine
object.
LookUpEngine objects are provided with DependencyInjection. The system that gets the currently valid LookUpEngine inherits the ILookUpEngineResolver.
Also Read
- LookUp System
- LookUp Tokens Explained
- DataSource Configuration: Configuration.Parse()
- ToSic.Eav.LookUp
- ToSic.Sxc.LookUp
- ToSic.Sxc.Dnn.LookUp
History
- General Tokens introduced in 2sxc 1.0
- Most enhancements were in 2sxc 07.00