So I want to know how I can get all the entries where my sessionId equals to (for example: 4).
public async Task<IActionResult> Index(int? session)
{
var cardio = await _client.GetEntries<CardioModel>();
// ContentfulCollection<CardioModel> cardioModels = new ContentfulCollection<CardioModel>();
// foreach (var model in cardio)
// {
// if(model.Session == 4){
// cardioModels.add(model)
// }
// }
return View(cardio);
}
I tried this but the .add isn't a thing, I tried various ways but none of them is working and I can't find good docs about what I want. I thought probably something with .getEntriesRaw()
but I don't know how to work with that.
public async Task<IActionResult> Index(int? session)
{
var cardio = await _client.GetEntries<CardioModel>();
// ContentfulCollection<CardioModel> cardioModels = new ContentfulCollection<CardioModel>();
// foreach (var model in cardio)
// {
// if(model.Session == 4){
// cardioModels.add(model)
// }
// }
return View(cardio);
}
How about just modifying just a little bit