Click or drag to resize
ServiceServiceInterfaceTryExecuteResultType Method

Note: This API is now obsolete.

Attempts to execute the given lambda expression over the service instance. If service instance is not available, does not execute and returns default value of ReturnType

Namespace: CMS.Core
Assembly: CMS.Core (in CMS.Core.dll) Version: 11.0.0
Syntax
C#
[ObsoleteAttribute("This functionality is no longer supported by Service<ServiceInterface> class. Resolve the service by an explicit call to CMS.Core.Service.Resolve<TService>() and execute the lambda over the service instance. Use CMS.Core.Service.IsRegistered(Type) to test whether service is registered.", 
	true)]
public static ResultType TryExecute<ResultType>(
	Func<ServiceInterface, ResultType> lambda
)

Parameters

lambda
Type: SystemFuncServiceInterface, ResultType

Type Parameters

ResultType

Return Value

Type: ResultType
See Also