Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit ae475ac

Browse files
committed
Add ormliteVar filter
1 parent d6930a4 commit ae475ac

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/ServiceStack.OrmLite/TemplateDbFilters.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public int dbExec(TemplateScopeContext scope, string sql, Dictionary<string, obj
8282
public string sqlLimit(int? limit) => padCondition(OrmLiteConfig.DialectProvider.SqlLimit(null, limit));
8383
public string sqlSkip(int? offset) => padCondition(OrmLiteConfig.DialectProvider.SqlLimit(offset, null));
8484
public string sqlTake(int? limit) => padCondition(OrmLiteConfig.DialectProvider.SqlLimit(null, limit));
85+
public string ormliteVar(string name) => OrmLiteConfig.DialectProvider.Variables.TryGetValue(name, out var value) ? value : null;
86+
8587
private string padCondition(string text) => string.IsNullOrEmpty(text) ? "" : " " + text;
8688
}
8789
}

src/ServiceStack.OrmLite/TemplateDbFiltersAsync.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public Task<object> dbExec(TemplateScopeContext scope, string sql, Dictionary<st
8484
public string sqlLimit(int? limit) => padCondition(OrmLiteConfig.DialectProvider.SqlLimit(null, limit));
8585
public string sqlSkip(int? offset) => padCondition(OrmLiteConfig.DialectProvider.SqlLimit(offset, null));
8686
public string sqlTake(int? limit) => padCondition(OrmLiteConfig.DialectProvider.SqlLimit(null, limit));
87+
public string ormliteVar(string name) => OrmLiteConfig.DialectProvider.Variables.TryGetValue(name, out var value) ? value : null;
88+
8789
private string padCondition(string text) => string.IsNullOrEmpty(text) ? "" : " " + text;
8890
}
8991
}

0 commit comments

Comments
 (0)