There is the code:
The signature of CacheItemUpdate Callback is:
I want to call InsertItemInCac he function using lamba expression for this.
This code is not compiled:
it says Expression does not produce a value
If I change Sub CacheItemUpdate Callback to Function CacheItemUpdate Callback
it also is not compiled
Can anyone help me to call this method via lambda expression? I want to use closure in the future and call this function in such way:
Code:
Private Sub InsertItemInCache(Of T)(ByVal item As CachedItem(Of T), ByVal dependency As AggregateCacheDependency, _ ByVal key As String, ByVal updateCallBack As CacheItemUpdateCallback)
Code:
Sub CacheItemUpdateCallback(ByVal key As String, ByVal reason As CacheItemUpdateReason, _ ByRef expensiveObject As Object, ByRef dependency As CacheDependency, ByRef absoluteExpiration As Date, _ ByRef slidingExpiration As TimeSpan)
I want to call InsertItemInCac he function using lamba expression for this.
This code is not compiled:
Code:
InsertItemInCache(cachedItem, dependency, key, Function(k, r, e, d, a, s) CacheItemUpdateCallback(k, r, e, d, a, s))
If I change Sub CacheItemUpdate Callback to Function CacheItemUpdate Callback
it also is not compiled
Can anyone help me to call this method via lambda expression? I want to use closure in the future and call this function in such way:
Code:
InsertItemInCache(cachedItem, dependency, key, Function(k, r, e, d, a, s) CacheItemUpdateCallbackNew(k, r, e, d, a, s, additionalParameter1, additionalParameter2, additionalParameter3))