ICompilerCache

Ecng.Compilation

Defines methods for caching compiled assemblies.

Свойства

Count
public int Count { get; }
value = iCompilerCache.Count

Gets the number of cached assemblies.

Методы

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.
Clear
public void Clear()
iCompilerCache.Clear()

Clears all cached assemblies.

InitAsync
public ValueTask InitAsync(CancellationToken cancellationToken)
result = iCompilerCache.InitAsync(cancellationToken)

Initializes the cache.

cancellationToken
Cancellation token.

Возвращает: 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.

Возвращает: 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.

Возвращает: true if the assembly was retrieved from the cache; otherwise, false.