38 lines
994 B
C#
38 lines
994 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
using MTG_CollectionVerwaltung.Data.MTGCollection;
|
|
using MTG_CollectionVerwaltung.Helpers;
|
|
|
|
namespace MTG_CollectionVerwaltung.Pages.Cards
|
|
{
|
|
public class SearchModel : PageModel
|
|
{
|
|
public List<CardPrinting> searchResults = new List<CardPrinting>();
|
|
|
|
public List<Set> Sets = new List<Set>();
|
|
|
|
private readonly ILogger<IndexModel> _logger;
|
|
|
|
private readonly MTGContext _context;
|
|
|
|
public SearchModel(ILogger<IndexModel> logger, MTGContext mTGContext)
|
|
{
|
|
_logger = logger;
|
|
_context = mTGContext;
|
|
}
|
|
|
|
public string CurrentQuery { get; set; }
|
|
|
|
public async Task<IActionResult> OnGet(string Searchquerry)
|
|
{
|
|
searchResults = CardSearcher.SearchCards(_context, Searchquerry);
|
|
|
|
Sets = _context.Sets.ToList();
|
|
|
|
CurrentQuery = Searchquerry;
|
|
|
|
return Page();
|
|
}
|
|
}
|
|
}
|