Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e7a798b5e9 | |||
| 494b806744 | |||
| 41b6b71b31 | |||
| 0702caa42d | |||
| ee6beef603 | |||
| 4f6dbfcd37 |
@@ -153,9 +153,7 @@ public sealed class ProductService(IDbContextFactory<MidrandBooksDbContext> cont
|
|||||||
{
|
{
|
||||||
await using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
|
await using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
|
||||||
|
|
||||||
var query = context.Products
|
var query = context.Products.AsQueryable();
|
||||||
.Include(i => i.Price)
|
|
||||||
.AsQueryable();
|
|
||||||
|
|
||||||
var cultureInfo = CultureInfo.InvariantCulture;
|
var cultureInfo = CultureInfo.InvariantCulture;
|
||||||
|
|
||||||
@@ -306,8 +304,7 @@ public sealed class ProductService(IDbContextFactory<MidrandBooksDbContext> cont
|
|||||||
{
|
{
|
||||||
await using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
|
await using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
|
||||||
|
|
||||||
var product = await context.Products
|
var product = await context.Products
|
||||||
.Include(i => i.Price)
|
|
||||||
.AsNoTracking().FirstOrDefaultAsync(p => p.Id == productId, cancellationToken);
|
.AsNoTracking().FirstOrDefaultAsync(p => p.Id == productId, cancellationToken);
|
||||||
|
|
||||||
return product is null
|
return product is null
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace LiteCharms.Features.Models;
|
||||||
|
|
||||||
|
public class SearchState
|
||||||
|
{
|
||||||
|
public string Query { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
public event Action? OnSearchSubmitted;
|
||||||
|
|
||||||
|
public void UpdateQuery(string newQuery) => Query = newQuery;
|
||||||
|
|
||||||
|
public void SubmitSearch() => OnSearchSubmitted?.Invoke();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user