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

Commit c85934a

Browse files
committed
Rename to LoadReferenceSelectFilter
1 parent a388a32 commit c85934a

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/ServiceStack.OrmLite/OrmLiteConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public static IOrmLiteExecFilter ExecFilter
176176
public static Action<IDbCommand, object> InsertFilter { get; set; }
177177
public static Action<IDbCommand, object> UpdateFilter { get; set; }
178178
public static Action<IUntypedSqlExpression> SqlExpressionSelectFilter { get; set; }
179-
public static Func<Type, string, string> SqlSelectRefFilter { get; set; }
179+
public static Func<Type, string, string> LoadReferenceSelectFilter { get; set; }
180180

181181

182182
public static Func<string, string> StringFilter { get; set; }

src/ServiceStack.OrmLite/Support/LoadList.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ protected string GetRefListSql(ModelDefinition refModelDef, FieldDefinition refF
5454
$"WHERE {dialectProvider.GetQuotedColumnName(refField)} " +
5555
$"IN ({subSql})";
5656

57-
if (OrmLiteConfig.SqlSelectRefFilter != null)
58-
sqlRef = OrmLiteConfig.SqlSelectRefFilter(refModelDef.ModelType, sqlRef);
57+
if (OrmLiteConfig.LoadReferenceSelectFilter != null)
58+
sqlRef = OrmLiteConfig.LoadReferenceSelectFilter(refModelDef.ModelType, sqlRef);
5959

6060
return sqlRef;
6161
}
@@ -101,8 +101,8 @@ protected string GetRefSelfSql(ModelDefinition modelDef, FieldDefinition refSelf
101101
$"WHERE {dialectProvider.GetQuotedColumnName(refModelDef.PrimaryKey)} " +
102102
$"IN ({subSqlRef})";
103103

104-
if (OrmLiteConfig.SqlSelectRefFilter != null)
105-
sqlRef = OrmLiteConfig.SqlSelectRefFilter(refModelDef.ModelType, sqlRef);
104+
if (OrmLiteConfig.LoadReferenceSelectFilter != null)
105+
sqlRef = OrmLiteConfig.LoadReferenceSelectFilter(refModelDef.ModelType, sqlRef);
106106

107107
return sqlRef;
108108
}
@@ -114,8 +114,8 @@ protected string GetRefFieldSql(ModelDefinition refModelDef, FieldDefinition ref
114114
$"WHERE {dialectProvider.GetQuotedColumnName(refField)} " +
115115
$"IN ({subSql})";
116116

117-
if (OrmLiteConfig.SqlSelectRefFilter != null)
118-
sqlRef = OrmLiteConfig.SqlSelectRefFilter(refModelDef.ModelType, sqlRef);
117+
if (OrmLiteConfig.LoadReferenceSelectFilter != null)
118+
sqlRef = OrmLiteConfig.LoadReferenceSelectFilter(refModelDef.ModelType, sqlRef);
119119

120120
return sqlRef;
121121
}

src/ServiceStack.OrmLite/Support/LoadReferences.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ protected string GetRefListSql(Type refType)
3838
var sqlFilter = dialectProvider.GetQuotedColumnName(refField.FieldName) + "={0}";
3939
var sql = dialectProvider.ToSelectStatement(refType, sqlFilter, pkValue);
4040

41-
if (OrmLiteConfig.SqlSelectRefFilter != null)
42-
sql = OrmLiteConfig.SqlSelectRefFilter(refType, sql);
41+
if (OrmLiteConfig.LoadReferenceSelectFilter != null)
42+
sql = OrmLiteConfig.LoadReferenceSelectFilter(refType, sql);
4343

4444
return sql;
4545
}
@@ -49,8 +49,8 @@ protected string GetRefFieldSql(Type refType, FieldDefinition refField)
4949
var sqlFilter = dialectProvider.GetQuotedColumnName(refField.FieldName) + "={0}";
5050
var sql = dialectProvider.ToSelectStatement(refType, sqlFilter, pkValue);
5151

52-
if (OrmLiteConfig.SqlSelectRefFilter != null)
53-
sql = OrmLiteConfig.SqlSelectRefFilter(refType, sql);
52+
if (OrmLiteConfig.LoadReferenceSelectFilter != null)
53+
sql = OrmLiteConfig.LoadReferenceSelectFilter(refType, sql);
5454

5555
return sql;
5656
}
@@ -65,8 +65,8 @@ protected string GetRefSelfSql(Type refType, FieldDefinition refSelf, ModelDefin
6565
var sqlFilter = dialectProvider.GetQuotedColumnName(refModelDef.PrimaryKey.FieldName) + "={0}";
6666
var sql = dialectProvider.ToSelectStatement(refType, sqlFilter, refPkValue);
6767

68-
if (OrmLiteConfig.SqlSelectRefFilter != null)
69-
sql = OrmLiteConfig.SqlSelectRefFilter(refType, sql);
68+
if (OrmLiteConfig.LoadReferenceSelectFilter != null)
69+
sql = OrmLiteConfig.LoadReferenceSelectFilter(refType, sql);
7070

7171
return sql;
7272
}

tests/ServiceStack.OrmLite.Tests/SoftDeleteTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void Can_get_active_vendor_and_active_references_using_SoftDelete_ref_fil
131131
}
132132
};
133133

134-
OrmLiteConfig.SqlSelectRefFilter = (type, sql) =>
134+
OrmLiteConfig.LoadReferenceSelectFilter = (type, sql) =>
135135
{
136136
var meta = type.GetModelMetadata();
137137
if (type.HasInterface(typeof(ISoftDelete)))
@@ -154,13 +154,13 @@ public void Can_get_active_vendor_and_active_references_using_SoftDelete_ref_fil
154154
}
155155

156156
OrmLiteConfig.SqlExpressionSelectFilter = null;
157-
OrmLiteConfig.SqlSelectRefFilter = null;
157+
OrmLiteConfig.LoadReferenceSelectFilter = null;
158158
}
159159

160160
[Test]
161161
public void Can_get_single_vendor_and__load_active_references_using_soft_delete_ref_filter()
162162
{
163-
OrmLiteConfig.SqlSelectRefFilter = (type, sql) =>
163+
OrmLiteConfig.LoadReferenceSelectFilter = (type, sql) =>
164164
{
165165
var meta = type.GetModelMetadata();
166166
if (type.HasInterface(typeof(ISoftDelete)))
@@ -182,7 +182,7 @@ public void Can_get_single_vendor_and__load_active_references_using_soft_delete_
182182
Assert.That(vendor.Products.Count, Is.EqualTo(1));
183183
}
184184

185-
OrmLiteConfig.SqlSelectRefFilter = null;
185+
OrmLiteConfig.LoadReferenceSelectFilter = null;
186186
}
187187
}
188188
}

0 commit comments

Comments
 (0)