Allow Filters on different sources to share the same name

Allows Posts and Comments to both use the IsNew filter with their own implementations.
This commit is contained in:
Matt Furden
2018-06-15 01:16:36 -07:00
parent abb7029c70
commit d792813cd5
5 changed files with 225 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
using Sieve.Services;
using SieveUnitTests.Entities;
@@ -13,6 +14,13 @@ namespace SieveUnitTests.Services
return result;
}
public IQueryable<Comment> IsNew(IQueryable<Comment> source, string op, string value)
{
var result = source.Where(c => c.DateCreated > DateTimeOffset.UtcNow.AddDays(-2));
return result;
}
public IQueryable<Comment> TestComment(IQueryable<Comment> source, string op, string value)
{
return source;