Search by forum title
This commit is contained in:
parent
3707a8dce2
commit
b1dcf5f72d
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using BL.DTOs;
|
using BL.DTOs;
|
||||||
using BL.Factories;
|
using BL.Factories;
|
||||||
using BL.Interfaces;
|
using BL.Interfaces;
|
||||||
@ -64,7 +65,10 @@ namespace BL.Services
|
|||||||
|
|
||||||
public IEnumerable<FoorumDTO> SearchFoorumTitle(string query)
|
public IEnumerable<FoorumDTO> SearchFoorumTitle(string query)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
foreach (var f in _foorumRepository.GetMany(f => f.Title.ToLower().Contains(query.ToLower())).OrderBy(f => f.CreationTime))
|
||||||
|
{
|
||||||
|
yield return _factory.Create(f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<PostDTO> SearchPostAuthor(string query)
|
public IEnumerable<PostDTO> SearchPostAuthor(string query)
|
||||||
|
@ -18,9 +18,13 @@ namespace WebApi.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IHttpActionResult Get(string author)
|
public IHttpActionResult GetAuthor(string author)
|
||||||
{
|
{
|
||||||
return Ok(_foorumService.SearchFoorumAuthor(author));
|
return Ok(_foorumService.SearchFoorumAuthor(author));
|
||||||
}
|
}
|
||||||
|
public IHttpActionResult GetTitle(string title)
|
||||||
|
{
|
||||||
|
return Ok(_foorumService.SearchFoorumTitle(title));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user