❔ Viewing List from ViewBag
I'm not sure what to cast to make the
Method creating the ViewBag:
What
resultresult in ViewBag.CardsReturnedViewBag.CardsReturned usable in the view. (Sorry if this was a load of unnecessary information)Method creating the ViewBag:
public async Task<IActionResult> Search(string searchString)
{
ICardService service = serviceProvider.GetCardService();
var result = await service.Where(x => x.Name, searchString).AllAsync();
ViewBag.CardsReturned = result;
return View();
} public async Task<IActionResult> Search(string searchString)
{
ICardService service = serviceProvider.GetCardService();
var result = await service.Where(x => x.Name, searchString).AllAsync();
ViewBag.CardsReturned = result;
return View();
}What
ICardServiceICardService and AllSyncAllSync are:public interface ICardService : IMtgQueryable<ICardService, CardQueryParameter>
{
//
// Summary:
// Gets all the MtgApiManager.Lib.Model.Card defined by the query parameters.
//
// Returns:
// A MtgApiManager.Lib.Core.IOperationResult`1 representing the result containing
// all the items.
Task<IOperationResult<List<ICard>>> AllAsync();
//
// Summary:
// Find a specific card by its multi verse identifier.
//
// Parameters:
// multiverseId:
// The multi verse identifier to query for.
//
// Returns:
// A MtgApiManager.Lib.Core.IOperationResult`1 representing the result containing
// a MtgApiManager.Lib.Model.Card or an exception.public interface ICardService : IMtgQueryable<ICardService, CardQueryParameter>
{
//
// Summary:
// Gets all the MtgApiManager.Lib.Model.Card defined by the query parameters.
//
// Returns:
// A MtgApiManager.Lib.Core.IOperationResult`1 representing the result containing
// all the items.
Task<IOperationResult<List<ICard>>> AllAsync();
//
// Summary:
// Find a specific card by its multi verse identifier.
//
// Parameters:
// multiverseId:
// The multi verse identifier to query for.
//
// Returns:
// A MtgApiManager.Lib.Core.IOperationResult`1 representing the result containing
// a MtgApiManager.Lib.Model.Card or an exception.