Addind extension methods to provide IsLike shortcuts, and fixing regressions.

--HG--
branch : NH3
This commit is contained in:
Sebastien Ros
2012-07-13 15:02:34 -07:00
parent b2e5973deb
commit a7573e26ba
2 changed files with 14 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
c47525e90819321d37962a11313006a4ccfc8362 src/Orchard.Web/Modules/Orchard.AntiSpam
86eb54fecd30f01ee9157d77def9e1a1aef2d6c3 src/Orchard.Web/Modules/Orchard.Autoroute
f41ead8138ef8eaec32e2c2826100ca175c15730 src/Orchard.Web/Modules/Orchard.Autoroute
a8cd78f4730747bf592935aaa605874938a9c89f src/Orchard.Web/Modules/Orchard.ContentPermissions
d466369118538a8ca77754d047ee841d016ea9c2 src/Orchard.Web/Modules/Orchard.ContentPicker
3ad1bdc80b8374433d98469e8740bc48ef114be2 src/Orchard.Web/Modules/Orchard.CustomForms

View File

@@ -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 {