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