#19647: Validation feed query parameter

Work Item: 19647

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-05-13 15:17:15 -07:00
parent ea44b76241
commit 63d2596152
3 changed files with 11 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
using System;
using JetBrains.Annotations;
using Orchard.Comments.Models;
using Orchard.ContentManagement;
@@ -25,8 +26,9 @@ namespace Orchard.Comments.Feeds {
var limit = 20;
var limitValue = context.ValueProvider.GetValue("limit");
if (limitValue != null)
limit = (int)limitValue.ConvertTo(typeof(int));
if (limitValue != null) {
Int32.TryParse(Convert.ToString(limitValue), out limit);
}
var comments = _contentManager
.Query<CommentPart, CommentPartRecord>()

View File

@@ -1,3 +1,4 @@
using System;
using JetBrains.Annotations;
using Orchard.Comments.Models;
using Orchard.ContentManagement;
@@ -25,8 +26,9 @@ namespace Orchard.Comments.Feeds {
var limit = 20;
var limitValue = context.ValueProvider.GetValue("limit");
if (limitValue != null)
limit = (int)limitValue.ConvertTo(typeof(int));
if (limitValue != null) {
Int32.TryParse(Convert.ToString(limitValue), out limit);
}
var comments = _contentManager
.Query<CommentPart, CommentPartRecord>()

View File

@@ -43,8 +43,9 @@ namespace Orchard.Projections.StandardQueries {
var limitValue = context.ValueProvider.GetValue("limit");
var limit = 20;
if (limitValue != null)
limit = (int)limitValue.ConvertTo(typeof(int));
if (limitValue != null) {
Int32.TryParse(Convert.ToString(limitValue), out limit);
}
var containerId = (int)projectionId.ConvertTo(typeof(int));
var container = _contentManager.Get<ProjectionPart>(containerId);