Table of Contents

Class Tools

Namespace
LinqToDB.Internal.Common
Assembly
linq2db.dll

Various general-purpose helpers.

public static class Tools
Inheritance
object
Tools

Methods

CreateEmptyQuery<T>()

public static IQueryable<T> CreateEmptyQuery<T>()

Returns

IQueryable<T>

Type Parameters

T

IsNullOrEmpty(ICollection?)

Checks that collection is not null and have at least one element.

public static bool IsNullOrEmpty(this ICollection? array)

Parameters

array ICollection

Collection to check.

Returns

bool

true if collection is null or contains no elements, false otherwise.

IsProviderAssemblyPresent(string)

Determines whether a provider backend assembly with the given simple name is present — that is, it is already loaded, can be loaded via Load(string), or its .dll is physically deployed next to the linq2db assembly.

public static bool IsProviderAssemblyPresent(string assemblyName)

Parameters

assemblyName string

Simple name of the provider assembly to look for.

Returns

bool

true if the assembly is loaded, loadable, or deployed next to linq2db.

Remarks

As a side effect this may load assemblyName into the current context. The file-existence fallback is intentionally disabled under PublishSingleFile deployments (where Location is empty) and never probes the current working directory — that current-directory fallback was the original single-file detection bug (linq2db#5488).

ToDebugDisplay(string)

public static string ToDebugDisplay(string str)

Parameters

str string

Returns

string

TryLoadAssembly(string?, string?)

public static Assembly? TryLoadAssembly(string? assemblyName, string? providerFactory)

Parameters

assemblyName string
providerFactory string

Returns

Assembly