mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
Addind extension methods to provide IsLike shortcuts, and fixing regressions.
--HG-- branch : NH3
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NHibernate.Criterion;
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
@@ -137,6 +138,18 @@ namespace Orchard.ContentManagement {
|
||||
return query.Slice(0, count);
|
||||
}
|
||||
|
||||
public static bool IsStartingWith(this string property, string value) {
|
||||
return property.IsLike(value + "*");
|
||||
}
|
||||
|
||||
public static bool IsEndingWith(this string property, string value) {
|
||||
return property.IsLike("*" + value);
|
||||
}
|
||||
|
||||
public static bool IsContaining(this string property, string value) {
|
||||
return property.IsLike("*" + value + "*");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class ContentGetExtensions {
|
||||
|
||||
Reference in New Issue
Block a user