ICompilerCache
Ecng.Compilation
Defines methods for caching compiled assemblies.
Eigenschaften
Methoden
Add
public void Add(string ext, IEnumerable<string> sources, IEnumerable<string> refs, byte[] assembly)
iCompilerCache.Add(ext, sources, refs, assembly)
Adds a compiled assembly to the cache.
- ext
- The file extension used in key generation.
- sources
- The source code files.
- refs
- The referenced assemblies.
- assembly
- The compiled assembly bytes to cache.
InitAsync
public ValueTask InitAsync(CancellationToken cancellationToken)
result = iCompilerCache.InitAsync(cancellationToken)
Initializes the cache.
- cancellationToken
- Cancellation token.
Rückgabe: A task representing the asynchronous operation.
Remove
public bool Remove(string ext, IEnumerable<string> sources, IEnumerable<string> refs)
result = iCompilerCache.Remove(ext, sources, refs)
Removes a cached assembly based on extension, sources, and references.
- ext
- The file extension used in key generation.
- sources
- The source code files.
- refs
- The referenced assemblies.
Rückgabe: true if the assembly was removed; otherwise, false.
TryGet
public bool TryGet(string ext, IEnumerable<string> sources, IEnumerable<string> refs, Byte[] assembly)
result = iCompilerCache.TryGet(ext, sources, refs, assembly)
Tries to retrieve a cached assembly based on extension, sources, and references.
- ext
- The file extension used in key generation.
- sources
- The source code files.
- refs
- The referenced assemblies.
- assembly
- When this method returns, contains the cached assembly if found; otherwise, null.
Rückgabe: true if the assembly was retrieved from the cache; otherwise, false.