DatabaseCaretReferences class
namespace: Serenity.Data assembly: Serenity.Net.Services
Helper class for replacing database caret references in format [^ConnectionKey] in SQL expressions.
public class DatabaseCaretReferences
Public Members
| name | description |
|---|---|
| DatabaseCaretReferences() | The default constructor. |
| static GetDatabaseName { get; set; } | Temporary workaround as this class has no reference to SQL connection strings. Getter returns the local resolver if any is set through SetLocalGetDatabaseName, otherwise the default one. The default resolver should only be set on application start. The local resolver should be used for unit tests. |
| static Replace(…) | Replaces caret references like [^ConnectionKey] in the specified expression with actual database names. |
| static SetLocalGetDatabaseName(…) | Sets the local database name resolver for the current thread and async context. Useful for background tasks, async methods, and testing to set the resolver locally and for auto spawned threads. |
See Also
- Source: DatabaseCaretReferences.cs