InitialCode Commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user