mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-22 05:22:57 +01:00
Made test stuff not generic
This commit is contained in:
parent
135e7255a8
commit
fe7234f571
@ -13,10 +13,10 @@ namespace SieveTests.Controllers
|
|||||||
[Route("api/[controller]/[action]")]
|
[Route("api/[controller]/[action]")]
|
||||||
public class PostsController : Controller
|
public class PostsController : Controller
|
||||||
{
|
{
|
||||||
private ISieveProcessor<Post> _sieveProcessor;
|
private ISieveProcessor _sieveProcessor;
|
||||||
private ApplicationDbContext _dbContext;
|
private ApplicationDbContext _dbContext;
|
||||||
|
|
||||||
public PostsController(ISieveProcessor<Post> sieveProcessor,
|
public PostsController(ISieveProcessor sieveProcessor,
|
||||||
ApplicationDbContext dbContext)
|
ApplicationDbContext dbContext)
|
||||||
{
|
{
|
||||||
_sieveProcessor = sieveProcessor;
|
_sieveProcessor = sieveProcessor;
|
||||||
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace SieveTests.Services
|
namespace SieveTests.Services
|
||||||
{
|
{
|
||||||
public class SieveCustomFilterMethodsOfPosts : ISieveCustomFilterMethods<Post>
|
public class SieveCustomFilterMethods : ISieveCustomFilterMethods
|
||||||
{
|
{
|
||||||
public IQueryable<Post> IsNew(IQueryable<Post> source, string op, string value)
|
public IQueryable<Post> IsNew(IQueryable<Post> source, string op, string value)
|
||||||
{
|
{
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace SieveTests.Services
|
namespace SieveTests.Services
|
||||||
{
|
{
|
||||||
public class SieveCustomSortMethodsOfPosts : ISieveCustomSortMethods<Post>
|
public class SieveCustomSortMethods : ISieveCustomSortMethods
|
||||||
{
|
{
|
||||||
public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy, bool desc)
|
public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy, bool desc)
|
||||||
{
|
{
|
@ -35,12 +35,9 @@ namespace SieveTests
|
|||||||
|
|
||||||
services.Configure<SieveOptions>(Configuration.GetSection("Sieve"));
|
services.Configure<SieveOptions>(Configuration.GetSection("Sieve"));
|
||||||
|
|
||||||
|
services.AddScoped<ISieveCustomSortMethods, SieveCustomSortMethods>();
|
||||||
//services.AddScoped<ISieveProcessor, SieveProcessor>();
|
services.AddScoped<ISieveCustomFilterMethods, SieveCustomFilterMethods>();
|
||||||
services.AddScoped<ISieveCustomSortMethods<Post>, SieveCustomSortMethodsOfPosts>();
|
services.AddScoped<ISieveProcessor, SieveProcessor>();
|
||||||
services.AddScoped<ISieveCustomFilterMethods<Post>, SieveCustomFilterMethodsOfPosts>();
|
|
||||||
services.AddScoped<ISieveProcessor<Post>, SieveProcessor<Post>>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
|
Loading…
Reference in New Issue
Block a user