Compare commits
No commits in common. "a8ec0cee16b8022ebe0d030c422935a4f33cc1ec" and "f23552a0001d1dfdfac5514dda1e3397dcb31831" have entirely different histories.
a8ec0cee16
...
f23552a000
@ -1 +0,0 @@
|
||||
[Dd]eploy/
|
@ -28,7 +28,7 @@ namespace RhSolutions.Api.Controllers
|
||||
public IEnumerable<Product> GetProduct(string id)
|
||||
{
|
||||
return dbContext.Products
|
||||
.Where(p => p.Id.Equals(id));
|
||||
.Where(p => p.ProductSku!.Equals(id));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
@ -4,25 +4,24 @@ using RhSolutions.Models;
|
||||
|
||||
namespace RhSolutions.Api.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
public class SearchController : ControllerBase
|
||||
{
|
||||
private RhSolutionsContext context;
|
||||
[Route("api/[controller]")]
|
||||
public class SearchController : ControllerBase
|
||||
{
|
||||
private RhSolutionsContext context;
|
||||
|
||||
public SearchController(RhSolutionsContext context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
public SearchController(RhSolutionsContext context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IAsyncEnumerable<Product> SearchProducts([FromQuery] string query)
|
||||
{
|
||||
return context.Products
|
||||
.Where(p => EF.Functions.ToTsVector(
|
||||
"russian", string.Join(' ', new[] { p.Name, string.Join(' ', p.ProductLines)}))
|
||||
.Matches(EF.Functions.WebSearchToTsQuery("russian", query)))
|
||||
.OrderByDescending(p => p.IsOnWarehouse)
|
||||
.AsAsyncEnumerable();
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public IAsyncEnumerable<Product> SearchProducts([FromQuery] string query)
|
||||
{
|
||||
return context.Products
|
||||
.Where(p => EF.Functions.ToTsVector(
|
||||
"russian", string.Join(' ', new[] { p.Name, string.Join(' ', p.ProductLines)}))
|
||||
.Matches(EF.Functions.WebSearchToTsQuery("russian", query)))
|
||||
.AsAsyncEnumerable();
|
||||
}
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ClosedXML" Version="0.100.0" />
|
||||
<PackageReference Include="ClosedXML" Version="0.101.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
Loading…
x
Reference in New Issue
Block a user